我试图让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) {
}
}
答案 0 :(得分:2)
在代码中提供user_birthday
的权限,
self.loginButton.publishPermissions = @[@"basic_info", @"email", @"user_friends",@"user_birthday"];
在V 2.4中未经上述许可,您只能从Facebook获得name
和id
,
检查Facebook开发者网站Graph Exploror
未经user_birthday
许可,出现错误,