All of a sudden Facebook Login redirection is not working.
As you can see from the code below redirection has been set. Both alerts that I have set areexecuted and this code (Apperyio.navigateTo('test', {reloadPage: true});) between the two alerts is just being ignored.
Redirect Page is whitelisted with Facebook.
As I said this was working perfectly and now has stopped.
Helper.init = function() {
Code: Select all
var callbackUrl = "[url=https://appery.io/app/view/]https://appery.io/app/view/[/url]" + Facebook_API_settings.project_id + "/app/test.html";
var url = "[url=https://www.facebook.com/dialog/oauth?client_id]https://www.facebook.com/dialog/oauth...[/url]=" + Facebook_API_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();
alert("Navigation to");
Apperyio.navigateTo('test', {reloadPage: true});
alert("Navigation Complete");
}