小编Kas*_*idi的帖子

无法获取facebook-ios-sdk中user_birthday和user_hometown的权限

我无法获得user_birthdayuser_hometown的权限.我之前尝试使用此代码但它只询问公共配置文件并忽略其他配置文件.

[FBSession openActiveSessionWithReadPermissions:@[@"public_profile",@"user_birthday",@"user_hometown"]
                                           allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if (error) {
 NBAppDelegate* appDel = (NBAppDelegate*)`[UIApplication sharedApplication].delegate;
 [appDel sessionStateChanged:session state:status error:error];
}

if ([session isOpen]) {
    [self loginWithFBToken:session name:sender];
}

}];
Run Code Online (Sandbox Code Playgroud)

然后有人建议在获取公开个人资料后要求额外的权限,所以我甚至尝试了这个没有好处.

这是代码

- (void)loadFbDetails
{
    NSArray *permissionsNeeded = @[@"user_hometown", @"user_birthday"];
    // Request the permissions the user currently has
    [FBRequestConnection startWithGraphPath:@"/me/permissions"
       completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
                          if (!error){
                              // These are the current permissions the user has:
                              NSDictionary …
Run Code Online (Sandbox Code Playgroud)

facebook facebook-graph-api ios facebook-ios-sdk

3
推荐指数
1
解决办法
1万
查看次数