Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Login - iOS 9 - Without Safari

People also ask

Does iOS 9 support Facebook?

In order to run your app on iOS 9, you need to upgrade to the latest Facebook SDK for iOS and take the following actions.

How do I log into Facebook on iOS?

To start, go to the home screen on your iPhone (Image 1). Click on the dark blue icon with a white “f” on it to access your Facebook account (this is the Facebook application icon). Type in your, previously established, E-mail address and your Facebook password to log into your account (Image 2).

What iOS do you need for Facebook?

Requires iOS 13.4 or later.


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


I noticed that in both changelogs, as well:

Facebook SDK for iOS Changelog v4.x

(v4.6.0 - September 10, 2015) 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. Follow the our Preparing for iOS 9 guide.

Facebook SDK for iOS Changelog v3.x

(v3.24.0 - September 10th 2015) 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. Follow the our Preparing for iOS 9 guide.