Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

iphone - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...