I'm trying to get facebook user birthday. So far I am successfully getting user first_name, last_name,email,name,gender except birthday
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) {
}
}
Give the Permission of user_birthday
in your code,
self.loginButton.publishPermissions = @[@"basic_info", @"email", @"user_friends",@"user_birthday"];
Without above permission in V 2.4 you get only name
and id
from facebook,
Check Facebook developer site Graph Exploror
Without permission of user_birthday
, got an error,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.