Facebook Login - iOS 9 - Without Safari

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


From now You can change loginBehavior to FBSDKLoginBehaviorSystemAccount, so FBSDKLoginManager gets Facebook logged in user from iOS Facebook Settings ;)

FBSDKLoginManager *fbLogin = [[FBSDKLoginManager alloc] init];
fbLogin.loginBehavior = FBSDKLoginBehaviorSystemAccount;

From FBSDKLoginManager:

Declaration: FBSDKLoginBehaviorSystemAccount
Description: If the account is not available to the app (either not configured by user or as determined by the SDK) this behavior falls back to FBSDKLoginBehaviorNative.
Note: If the account is not available to the app (either not configured by user or as determined by the SDK) this behavior falls back to FBSDKLoginBehaviorNative.


Using 20150708 solved it for me in iOS 9.

Link to SDK: https://developers.facebook.com/resources/FacebookSDKs-iOS-20150708.pkg


If you want to use the latest SDK and also the native login behaviour on iOS 9

Edit FBSDKServerConfiguration.m's function to always return true

- (BOOL)useNativeDialogForDialogName:(NSString *)dialogName
{
  return @YES;
}

Falling back to Safari still work if the Facebook app isn't installed