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.
according to https://developers.facebook.com/bugs/1701456353419877/ it was a bug on facebook, and it's now fixed.
Saw that, and it indeed seems to be fixed. Thanks! I'll mark yours as the answer.
I think actually stackoverflow.com/users/2558714/igix deserves the credit for posting the link to facebook in the first place.
You're right, though I'm not sure how to give credit to a comment. If igix posts as an answer I will be happy to change it.
Happened on my app, and I'm using FBiOSSDK.4.35.0
FBSDKLog: Response <#1295> Duration: 359 msec Size: 16 kB Response Body: ( { body = { success = 1; }; code = 200; } )