-canOpenURL: failed URL: "fbauth2: /" (OSStatus error -10814.) "

I am adding the Facebook and Google application to the application, but I have this problem.

The operation could not be completed. -10814

on Facebook, and I don’t know how to solve it, this is my delegate application code for openUrl :

  func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool { if let fbSDKAppId = FBSDKSettings.appID(), url.scheme!.hasPrefix("fb\(fbSDKAppId)"), url.host == "authorize" { var shouldOpen :Bool = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String!,annotation:options[UIApplicationOpenURLOptionsKey.annotation]) return shouldOpen } else { return GIDSignIn.sharedInstance().handle(url, sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: [:]) } } 

What can I do?

+5
source share
2 answers

now I used the latest SDK v4.26.0 , downloaded from here , and I followed the link for the installation steps for FB. and my code

 FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; if ([[[UIDevice currentDevice] systemVersion] floatValue] <= 9) { // After iOS9 we can not use it anymore login.loginBehavior = FBSDKLoginBehaviorSystemAccount; } else { login.loginBehavior = FBSDKLoginBehaviorWeb; } NSArray *permission = [[NSArray alloc] initWithObjects:@"email",@"public_profile",@"user_friends", nil]; NSLog( @"### running FB sdk version: %@", [FBSDKSettings sdkVersion] ); [login logInWithReadPermissions:permission fromViewController:(UIViewController *)self handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { [self removeActivityIndicatorWithBg:activityIndicator]; if (error) { NSLog(@"Process error"); } else if (result.isCancelled) { NSLog(@"Cancelled"); } else { NSLog(@"Logged in%@",result.grantedPermissions); } }]; 

here I used login behavior as FBSDKLoginBehaviorSystemAccount and I got an error like

(- error: "Operation could not be performed. -10814)

therefore, in my simulator or device there are no account settings in the system settings for facebook. then it appears on the next block

 if (error) { NSLog(@"Process error"); } 

if I print a mistake

No Facebook account. There are no Facebook accounts configured. You can add or create a Facebook account in the settings.

so I changed loginBehavior from FBSDKLoginBehaviorSystemAccount to FBSDKLoginBehaviorWeb , I got all OP with an error

+6
source

LSApplicationQueriesSchemes property set in info.plist solved the problem for me.
Check the attached screenshot:

info.plist

+1
source

Source: https://habr.com/ru/post/1271972/


All Articles