Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blank white screen after FB login via web app?

I have tried following the FB mobile web "getting started guide" at: https://developers.facebook.com/docs/guides/mobile/web/ for a web app that I open full-screen on my iphone.

but when I try to login using the fb login page that opens up, I get a blank white screen after I click the "login" button. The user IS logged in though.. I know this because if I close and reopen my web app, I check the login status and try to get some user info, and it works fine...

When I try the same web app in my desktop's chrome or my iphone's safari, the login process is ok... it break only from within the full screen web app.

any ideas?? I'm merely following the sample code from FB :-(

thanks.

like image 230
Sagi Mann Avatar asked Nov 05 '11 11:11

Sagi Mann


1 Answers

All you need to do is adding " display:'touch' " and redirect_uri parameters to the login as :

FB.login(function(response) {
   if (response.authResponse) {
     console.log('Welcome!  Fetching your information.... ');
     FB.api('/me', function(response) {
      console.log('Good to see you, ' + response.name + '.');
       FB.logout(function(response) {
         console.log('Logged out.');
       });
     });
  } else {
    console.log('User cancelled login or did not fully authorize.');
  }
}, {scope: 'email,publish_stream' , redirect_uri: 'YOUR_REDIRECT_URL' , display : 'touch'});
like image 155
Al-Mutaz Bellah Ahmad Salahat Avatar answered Sep 29 '22 06:09

Al-Mutaz Bellah Ahmad Salahat