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.

Leave a Comment