Alexis Revue
Posts: 0
Joined: Wed Jul 02, 2014 4:28 am

InAppBrowser still open after successful FB login

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', {}); 

     }
Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

InAppBrowser still open after successful FB login

Hello!

Could you clarify your iOS version?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

InAppBrowser still open after successful FB login

Seems to be a bug, sorry about that.. Bug is reported, we will fix it.

Alexis Revue
Posts: 0
Joined: Wed Jul 02, 2014 4:28 am

InAppBrowser still open after successful FB login

Hi Maryna,

Ok, thank you, I'll wait for the correction :)
IOS 7.1.2

Alexis Revue
Posts: 0
Joined: Wed Jul 02, 2014 4:28 am

InAppBrowser still open after successful FB login

Hi,

Any news from that bug?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

InAppBrowser still open after successful FB login

Hi Alexis,

No status update yet, it seems to be a complicated one.

Alexis Revue
Posts: 0
Joined: Wed Jul 02, 2014 4:28 am

InAppBrowser still open after successful FB login

Hi Illya,

Would there be another way to login using facebook without having this issue?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

InAppBrowser still open after successful FB login

We are searching for a workaround, we'll let you know.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

InAppBrowser still open after successful FB login

Hello!

Please try changing Libraries version to 1.2

Alexis Revue
Posts: 0
Joined: Wed Jul 02, 2014 4:28 am

InAppBrowser still open after successful FB login

Hello!

It works fine with 1.2, thank you. That's great.
I'm still interested in the fix for 2.0 but I'm not in a hurry :)

Return to “Issues”