Facebook Login - iOS 9 - Without Safari

user4200570 picture user4200570 · Sep 17, 2015 · Viewed 18.6k times · Source

It worked fine to login with logInWithReadPermissions in iOS 8, but as soon after the update to iOS 9 it keeps opening Safari or a modal UIWebView.

Does anyone have the same issue?

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login setLoginBehavior:FBSDKLoginBehaviorNative];
[login logInWithReadPermissions:@[@"public_profile",@"email"] fromViewController:nil handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
    NSLog(@"");
}];

Answer

Lucas Brito picture Lucas Brito · Sep 17, 2015

Seems there's no way to get the previous behavior using newests FB SDKs in iOS9+. You can use an old SDK to do that. Here's a response from the facebook to that question: enter image description here