Warm tip: This article is reproduced from serverfault.com, please click

"Please close this tab to continue" error in iOS

发布于 2015-10-07 17:14:27

I'm using the PHP SDK (v5.0) to log users into my site, using the basic code from Facebook's docs (I filled in and/or changed the necessary parts for my website):

# login.php
$fb = new Facebook\Facebook([
        'app_id' => FACEBOOK_APP_ID,
        'app_secret' => FACEBOOK_APP_SECRET,
        'default_graph_version' => FACEBOOK_GRAPH_API_VERSION,
    ]);

$helper = $fb->getRedirectLoginHelper();
$permissions = ['email', 'user_likes']; // optional
$loginUrl = $helper->getLoginUrl('http://{your-website}/login-callback.php', $permissions);

echo '<a href="' . $loginUrl . '">Log in with Facebook!</a>';

I have a login callback file setup that logs the user into my site, and it works perfectly on any OS other than iOS. Laptop/Desktop is fine, Android works fine, etc. Just on iOS (I tried using Chrome and Safari in iOS 9), instead of redirecting back to the login callback after login, it keeps them on Facebook and says "Please close this tab to continue to {website}." So basically the user, on iOS, is never returned to my site after logging in to Facebook.

If I close the tab (as the error message says), I obviously am out of both Facebook and my website and have to start over. If I hit the back button, I go back to my site, but I am not logged in.

Does anyone know why this is happening? I'm using PHP 5.5.

P.S. This is not just happening on my site. I just tried to login with Facebook on trulia.com on my iPhone and the same happens! Any help/links/docs would be greatly appreciated.

Questioner
Micah
Viewed
0
gingerlime 2015-10-15 03:42:35

according to https://developers.facebook.com/bugs/1701456353419877/ it was a bug on facebook, and it's now fixed.