Hello,
Here is a screenshot from my developer.facebook app settings. And also, here is a screenshot of my data mapping for this service. The request is from the local storage variables, access_token.
I will also note that I deleted the auto-generated Facebook_me page from the project, and I made changes to the facebook_helper.js file. This is were I made this changes, changing the page info to 'homePage';
(function(context) {
Helper = {};
var ref;
// var projectId = window.location.href.split("/")[5];
Code: Select all
Helper.init = function() {
var callbackUrl = "[url=http://appery.io/app/view/]http://appery.io/app/view/[/url]" + Facebook_Settings.project_id + "/homePage.html";
var url = "[url=https://www.facebook.com/dialog/oauth?client_id]https://www.facebook.com/dialog/oauth...[/url]=" + Facebook_Settings['client_id'] + "&redirect_uri=" + callbackUrl + "&scope=&response_type=token";
if (this.isPhoneGapApp()) {
ref = window.open(url, '_blank', 'location=yes');
ref.addEventListener("loadstart", this.getAccessToken);
} else {
window.open(url, "_self");
}
};
Helper.getAccessToken = function(event) {
if (event.url.indexOf('access_token') = 0) {
console.log("Extracting access_token...");
var params = event.url.split("access_token=");
var _access_token = params[1].slice(0, params[1].indexOf("&"));
localStorage.setItem('access_token', _access_token);
ref.close();
Appery.navigateTo('homePage', {});
}
};
Helper.isPhoneGapApp = function() {
return (document.URL.indexOf('a href="http://" rel="nofollow"http:///a') === -1 && document.URL.indexOf('a href="https://" rel="nofollow"https:///a') === -1);
};
if (window.location.href.indexOf("access_token") != -1) {
var hashFromFb = window.location.hash;
window.location.hash = '';
var paramsFromFb = hashFromFb.substring(1).split("&");
var access_token = paramsFromFb[0].split("=")[1];
localStorage.setItem('access_token', access_token);
}
context.Helper = Helper; })(window);
I also changed the the website/platform URL in Facebook settings to '/homePage.html'
Thanks again for your help.