-canOpenURL:URL失败:"fbauth2:/"; (OSStatus错误-10814.)" [英] -canOpenURL: failed for URL: "fbauth2:/" (OSStatus error -10814.)"
问题描述
我在我的应用程序中添加了Facebook和Google注册,但是我遇到了这个问题
i'm adding Facebook and Google signup in my application but i have this issue
操作无法完成. -10814
The operation couldn’t be completed. -10814
在Facebook登录名中,我不知道如何解决,这是我的openUrl
的应用程序委托代码:
in the Facebook login and i don't know how to solve it, this is my app delegate code for the 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: [:])
}
}
我能做什么?
推荐答案
现在我使用的是从链接有关为FB安装的步骤.我的代码是
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);
}
}];
在这里,我使用的登录行为是FBSDKLoginBehaviorSystemAccount
,而我收到的错误是
here i used the login behavior as FBSDKLoginBehaviorSystemAccount
and I get the error as
(-错误:操作无法完成.-10814)
(- error: "The operation couldn’t be completed. -10814)
因此,在我的模拟器或设备中,facebook的系统设置中未包含任何帐户设置.然后它会出现在以下代码段
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");
}
如果我显示错误,
没有Facebook帐户. 没有配置Facebook帐户.您可以在设置"中添加或创建Facebook帐户.
No Facebook account. There are no Facebook accounts configured. You can add or create a Facebook account in Settings.
所以我将loginBehavior从FBSDKLoginBehaviorSystemAccount
更改为FBSDKLoginBehaviorWeb
,我得到了所有没有错误的
so I changed the loginBehavior from FBSDKLoginBehaviorSystemAccount
to FBSDKLoginBehaviorWeb
, I got all OP with out error
这篇关于-canOpenURL:URL失败:"fbauth2:/"; (OSStatus错误-10814.)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!