gpt4 book ai didi

iphone - Facebook SDK : openActiveSessionWithPermissions completionHandler not called

转载 作者:可可西里 更新时间:2023-11-01 05:14:21 25 4
gpt4 key购买 nike

使用我已经实现的来自 Facebook 的代码

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"publish_actions",
nil];

return [FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
NSLog(@"error %@", error);
[self sessionStateChanged:session
state:state
error:error];
}];
}

它返回 NO,我理解这是因为这是第一次登录,并且 loginUI 工作(它将用户发送到 FB 并要求他们授予权限)然后返回,但 completionHandler block 永远不会运行。它只是返回到应用程序和 nada。

最佳答案

我假设您关注 Implement the Login Flow Facebook SDK 但值得再次阅读该部分,因为它解释了一切。确保您在委托(delegate)中处理了 openURL 和 handleOpenURL 方法。还要检查 openSessionWithAllowLoginUI almost always returns NO

关于iphone - Facebook SDK : openActiveSessionWithPermissions completionHandler not called,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12514740/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com