我试图用Facebook功能实现登录,但我收到以下错误回报。(com.facebook.sdk.login错误304.)与FBSDK 4.2错误
Login Failed with error: The operation couldn’t be completed. (com.facebook.sdk.login error 304.)
这里是我的代码
- (void)loginWithFacebook {
NSString *const read_actions = @"email";
[[[FBSDKLoginManager alloc] init]
logInWithReadPermissions:@[read_actions] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error)
{
if (error) {
NSLog(@"Login Failed with error: %@", error.localizedDescription);
}
else if (result.isCancelled)
{
NSLog(@"Login Failed due to Cancel");
}
else
{
if ([result.grantedPermissions containsObject:read_actions]) {
NSLog(@"Permission granted");
}
}
}];
}
该代码工作使用SDK的最新版本(现在的4.3版)适合我,在更新到最新版本后是否会失败并显示相同的消息?你是在真实的设备上还是在模拟器上运行? –