How to Use Facebook iOS Sdk on iOS 10

How to use Facebook iOS SDK on iOS 10

Error OSStatus -10814 occures when canOpenURL: can't find any application, that can open this URL (actually, Facebook trying to find their application by calling canOpenURL: with argument "fbauth2:/"). Printing happens inside of function, so you can't do anything with that.
But if you will run your application on device with installed Facebook app, you will not see this error.

Error 308 occures because of the situation, when value, stored in keychain is not equal to value, that is stored in facebook completion parameters (for more information you can check -[FBSDKLoginManager completeAuthentication:expectChallenge:]).

It happens because Apple changed the way of working with keychain in iOS 10. To fix this issue you simply should go to Targets->Capabilities and enable keychain sharing (it enables access to keychain for your app):
image

If you are using Xamarin (read this link for more information, thanks @dynamokaj):

Just make sure you enable the keychain access in Entitlements and
select the entitlements for Simulator (Debug) builds too. By default
this is not set.

Facebook SDK sign in with Swift 3 iOS 10

You have to substitute didfinishlaunching and openurl AppDelegate methods with below:

public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool 
{
return SDKApplicationDelegate.shared.application(application, didFinishLaunchingWithOptions: launchOptions)
}

public func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
{
return SDKApplicationDelegate.shared.application(app, open: url, options: options)
}

Objective c - iOS 10 Facebook login blank screen

I finally fixed it, in MenuViewController I changed the way to present the loginViewController to this:

[self.view.window.rootViewController presentViewController:vc animated:YES completion:nil];

Xamarin Facebook iOS10 SDK com.facebook.sdk.login Code=308

Believe it or not, I found the solution to this error doing the opposite of what is described here: https://forums.xamarin.com/discussion/39673/iphonesimulator-build-results-in-no-valid-ios-code-signing-keys-found-in-keychain

Basically, go to the Project Options > iOS Bundle Signing and add the Entitlements.plist at the "Custom Entitlements" text box. It works!

-- Julio

Facebook SDK Login doesn't work on simulator on iOS 10, Xcode 8

If its working fine on a real device, this means that you have successfully integrated the Facebook SDK. In order to make things working on iOS 10 simulator :
Go to the Project Target and then Capabilities and switch Keychain Sharing ON.

It will ask for a Team for the first time. Select a team and it will add a Keychain Group for you.

Sample Image

Can't login using Facebook Login on iOS 10

It turns out that the access token can be nil immediately after. You have to wait for a notification before it can be used. I think this is a new requirement.

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(checkLogIn) name: FBSDKAccessTokenDidChangeNotification object:nil];

.

That other error message was just a warning I think.



Related Topics



Leave a reply



Submit