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

后端 未结 4 782
一生所求
一生所求 2020-11-29 12:13

i\'m adding Facebook and Google signup in my application but i have this issue

The operation couldn’t be completed. -10814

in t

相关标签:
4条回答
  • 2020-11-29 12:43

    Worked after adding openUrl with options:

    Facebook documentation

    Note that application:openURL:options: is only available in iOS 9 and above. If you are building with an older version of the iOS SDK, you can use:

    - (BOOL)application:(UIApplication *)application 
                openURL:(NSURL *)url 
      sourceApplication:(NSString *)sourceApplication
             annotation:(id)annotation {
    
      BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
        openURL:url
        sourceApplication:sourceApplication
        annotation:annotation
      ];
      // Add any custom logic here.
      return handled;
    } 
    
    0 讨论(0)
  • 2020-11-29 12:47

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

    0 讨论(0)
  • 2020-11-29 12:56

    In this thread you can find an issue and a temporary fix for such kind of error.

    0 讨论(0)
  • 2020-11-29 13:08

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

    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 the login behavior as FBSDKLoginBehaviorSystemAccount and I get the error as

    (- error: "The operation couldn’t be completed. -10814)

    so in my simulator or device contains no accounts setup in system settings for facebook. then it comes on the following block

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

    if I print the error,

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

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

    0 讨论(0)
提交回复
热议问题