Facebook SDK 3.1登录错误

时间:2013-01-14 14:18:01

标签: ios facebook facebook-ios-sdk

当我登录FB时出现错误信息!! 错误日志: FBConditionalLog:FBSession:对读取权限的权限请求包含意外的发布或管理权限

- (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI {
    NSArray *permissions = [NSArray arrayWithObjects:@"publish_actions", @"user_photos", @"email", nil];
    return [FBSession openActiveSessionWithReadPermissions:permissions
                                              allowLoginUI:allowLoginUI
                                         completionHandler:^(FBSession *session,
                                                             FBSessionState state,
                                                             NSError *error) {
                                             [self sessionStateChanged:session
                                                                 state:state
                                                                 error:error];
                                         }];

如何添加@“publish_actions”权限而不是错误消息??

谢谢!

2 个答案:

答案 0 :(得分:2)

使用openActiveSessionWithPublishPermissions而不是openActiveSessionWithReadPermissions。

答案 1 :(得分:0)

类似这样的事情

NSArray *permissions = [NSArray arrayWithObjects:@"publish_actions", nil];

[[FBSession activeSession] reauthorizeWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceFriends completionHandler:^(FBSession *session, NSError *error) { /* handle success + failure in block */ }];

请参阅https://developers.facebook.com/docs/howtos/ios-6/