Search code examples
iosios9facebook-sdk-4.0

Facebook Login SDK in IOS 9


I am using the facebook login SDK. It is working perfectly in IOS 7, 8 and 9. But if phone have the facebook app login verification is open the app in iOS 7 AND 8. BUT IOS 9 not open the facebook app. It is open the browser (Web page) and doing the verification. What is the reason? Anybody have any idea?

Edited

 FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    [FBSDKProfile enableUpdatesOnAccessTokenChange:YES];

    [login logInWithReadPermissions:@[@"public_profile", @"email"]
                 fromViewController:self
                            handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {

                                if (error) {
                                    NSLog(@"Process error");
                                } else if (result.isCancelled) {
                                    NSLog(@"Cancelled");
                                } else {
                                    NSLog(@"Logged in");

                                    [[NSNotificationCenter defaultCenter] postNotificationName:FBSDKProfileDidChangeNotification object:nil];
                                }
                            }];

Solution

  • This is by design and is using SFSafariViewController on iOS 9. As noted in the v4.6 changelog,

    The SDK supports various iOS 9 features including Bitcode. In addition, the SDK dialogs such as Login, Like, Share Dialogs automatically determine the best UI based on the device, including SFSafariViewController instead of Safari

    We know this may be confusing at first but we definitely have the same goal as our developers to make sure the users get the best experience on iOS 9 and have a good Login experience. On iOS 8, the login will still prefer an app switch to the Facebook app.