Hi,
I use Facebook plugin but it seems like I have different behavior between iOs and Android: on iOs, after a successful login, I'm still in the InAppBrowser whereas with Android, I go back to the application which is what I expect. So, with iOS, I open the next page in inAppBrowser instead of navigating to this page in the App. I guess something is wrong with ref.close() but I can't fix it... any guess?
Alexis
Code: Select all
Helper.init = function() {
var callbackUrl = "[url=http://appery.io/app/view/]http://appery.io/app/view/[/url]" + Facebook_Settings.project_id + "/A1_FB_ME.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";
ref = window.open(url, '_blank', 'location=yes');
ref.addEventListener("loadstart", this.getAccessToken);
};
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('A1_FB_ME', {});
}