Facebook图表api v2.4没有返回生日

时间:2015-08-10 11:42:41

标签: ios iphone xcode facebook-graph-api

我试图让facebook用户过生日。到目前为止,我成功获得用户first_name,last_name,电子邮件,姓名,性别除了生日

self.loginButton.publishPermissions = @[@"basic_info", @"email", @"user_friends"];
self.loginButton.delegate =self;
FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init];
loginManager.loginBehavior = FBSDKLoginBehaviorSystemAccount;
[loginManager logInWithReadPermissions:@[@"email"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { 

[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me" parameters:@{@"fields" : @"first_name, last_name,email,name,gender,birthday"}]
                 startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {

}
}

1 个答案:

答案 0 :(得分:2)

在代码中提供user_birthday的权限,

self.loginButton.publishPermissions = @[@"basic_info", @"email", @"user_friends",@"user_birthday"];

在V 2.4中未经上述许可,您只能从Facebook获得nameid

检查Facebook开发者网站Graph Exploror

未经user_birthday许可,出现错误,

enter image description here