1

因为我不希望后备流程从 iOS6 登录对话框开始,所以我使用了

[FBSession.activeSession openWithBehaviour: completionHandler] 

@"basic_info"但想知道我可以在哪里添加权限参数,就像@"user_like"下面的方法一样 -

[FBSession openActiveSessionWithReadPermissions:@[@"basic_info", @"user_like"]
                               allowLoginUI:YES
                          completionHandler:^(FBSession *session,
                                              FBSessionState status,
                                              NSError *error) {
                              // Respond to session state changes, 
                              // ex: updating the view
                          }];

感谢您的任何建议。

4

1 回答 1

8

这是代码 -

  1. 读取权限

    ...
    [FBSession.activeSession requestNewReadPermissions:@[@"basic_info",@"user_likes"]
                             completionHandler:^(FBSession *session,
                                                 NSError *error) 
    {
        // Handle new permissions callback
    }];
    ...
    
  2. 发布权限

    ...
    [FBSession.activeSession requestNewPublishPermissions:@[@"basic_info",@"publish_actions"]
                                  defaultAudience:FBSessionDefaultAudienceFriends
                                completionHandler:^(FBSession *session, 
                                                    NSError *error) 
    {
       // Handle new permissions callback
    }];
    ... 
    
于 2013-08-22T18:31:20.863 回答