Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook OAuth "Unsupported" in Chrome on iOS

The Facebook OAuth popup is throwing an error in Chrome on iOS only. Both developers.facebook.com and google have turned up nothing about this. Ideas?

screenshot of facebook oath popup on mobile chrome on ios

like image 690
Daniel Miller Avatar asked May 30 '13 18:05

Daniel Miller


2 Answers

You can use the redirection method as follow for this case (by detecting the user agent being chrome ios):

https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri} 

See more info here https://developers.facebook.com/docs/facebook-login/login-flow-for-web-no-jssdk/

Remark: I personnaly use the server OAuth in that case but this should do the trick and is quite simple

like image 163
Kim D. Avatar answered Sep 20 '22 14:09

Kim D.


This is how I did it (fixing iOS chrome specifically)

// fix iOS Chrome if( navigator.userAgent.match('CriOS') )     window.open('https://www.facebook.com/dialog/oauth?client_id='+appID+'&redirect_uri='+ document.location.href +'&scope=email,public_profile', '', null); else     FB.login(null, {scope: 'email,public_profile'}); 
like image 32
vsync Avatar answered Sep 18 '22 14:09

vsync