Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default FBSDKLoginBehavior.Native not working on iOS 9

I just upgraded my app to Xcode 7 / Swift 2.0 and I'm struggling with the Facebook Login via AppSwitch. I'm on the latest FBSDK (4.6) and did everything according to the upgrade guide. Still, on iOS9 the Facebook login happens via in-app browser, the appswitch doesn't work anymore. I also tried force setting the loginbehavior but without luck:

let manager = FBSDKLoginManager()
manager.loginBehavior = FBSDKLoginBehavior.Native
manager.logInWithReadPermissions(facebookReadPermissions, fromViewController: nil, handler: { (loginResult, error) -> Void in

Is there anything I can do to make appswitch work again?

Thanks!

like image 391
Hannes Avatar asked Sep 17 '15 16:09

Hannes


Video Answer


1 Answers

Turns out that this is not an issue but the new desired behavior according to these posts from Facebook:

https://developers.facebook.com/bugs/1636969533209725/?comment_id=1011596265571252

This behavior is by design. In our latest iOS SDKs, the login behavior is now controlled on the server side in order to ensure the best user experience.

https://developers.facebook.com/bugs/786729821439894/?comment_id=1467419033584031

Because of introduced changes in iOS 9, This new behavior avoids the user to be asked if they want to go and open the Facebook Application, accept the permissions/share/etc, and then ask once more if they want to switch back to your app.

https://developers.facebook.com/bugs/1390559277910338/?comment_id=1661064587442645

System authentication doesn't give people control over the information they share with apps. And in iOS 9, fast-app-switching to the Facebook native app results in additional dialogs ("ExampleApp would like to open Facebook") which appear twice - once on the way from ExampleApp to Facebook, and once again on the return journey. We believe the default SDK behavior in v4.6 on iOS 9 offers the best experience to people logging into your app with Facebook.

like image 153
Hannes Avatar answered Sep 19 '22 13:09

Hannes