我使用的是Xcode 7 beta 6,iOS 9 beta 5。
在我现有的代码(在iOS 7和8中工作)中,我有以下内容:
FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
[login logInWithPublishPermissions:@[@"manage_pages"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
NSLog(@"There was an error with FB:\n %@",error.description);
} else if (result.isCancelled) {
} else {
if ([result.grantedPermissions containsObject:@"manage_pages"]) {
NSLog(@"permissions granted! %@",[[FBSDKAccessToken currentAccessToken]permissions]);
// Do work
[self facebookInfo];
}else{
NSLog(@"permissions NOT granted");
}
}
}];一旦应用程序切换到Facebook应用程序或Safari,处理程序就会抛出错误
There was an error with FB:
Error Domain=com.facebook.sdk.login Code=301 "(null)"在设备上,权限页面显示在Safari中,一旦您同意权限,就会提示Safari想要打开我的应用程序。一旦应用程序重新打开,任何事情都不会发生,考虑到处理程序已经失败,这是有意义的。
有人能解释一下这件事吗?我很难找到其他的例子。
非常感谢,
卢克
发布于 2015-09-13 02:11:00
解决这一问题的办法是,facebook似乎有问题。
在将我的项目pod文件降级为:
pod 'FBSDKCoreKit', '~> 4.2.0'
pod 'FBSDKLoginKit', '~> 4.1.0'
pod 'FBSDKShareKit', '~> 4.1.0' 我发现这个错误消失了,恢复了正常的操作。
这似乎是一个广泛发现的错误,已经开始出现在其他这样的问题。
发布于 2015-09-08 01:14:58
出于安全考虑,iOS 9要求将允许打开的应用程序白名单。请参阅本页的“白名单Facebook应用程序”一节:https://developers.facebook.com/docs/ios/ios9
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>发布于 2015-09-15 16:59:06
您能否再次尝试使用4.6SDK,并使用iOS 9和Xcode 7的GM种子?如果仍然存在问题,最好能向developers.facebook.com/bug提交一份报告,让我们帮助调试。谢谢!
(P.S.您通常应该避免在Podfile中使用不同版本的工具包)
https://stackoverflow.com/questions/32447565
复制相似问题