嗨,每次我运行它都会返回一个 FBSessionStateClosedLoginFailed 状态。我检查了我的捆绑包名称、URL 设置等,一切都很酷。事实上,脸书知道我已经通过该应用程序进行了身份验证。但是,每当我调用 openWithCompletion 时,我的会话都会失败!
[appDelegate.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
switch (status) {
case FBSessionStateOpen:
NSLog (@"Open");
break;
case FBSessionStateClosed:
NSLog (@"Closed");
break;
case FBSessionStateClosedLoginFailed:
NSLog (@"Failed");
break;
default:
break;
}
[self updateView];
}];
我在应用程序委托中创建了这个,它也被成功调用,但总是返回 false:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [FBSession.activeSession handleOpenURL:url];
}