在ios facebook sdk上授予user_birthday权限

时间:2016-04-01 05:59:30

标签: ios permissions facebook-sdk-4.0

我已经在user_birthday上授予了权限,但我无法获得用户bithday。结果[@" birthday"]返回结果为空,为什么?

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    [login
     logInWithReadPermissions: @[@"public_profile", @"user_birthday"]
     fromViewController:self
     handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
         if (error) {
             NSLog(@"Process error");
         } else if (result.isCancelled) {
             NSLog(@"Cancelled");
         } else {
             NSLog(@"Logged in");
             NSLog(@"result==%@", result.grantedPermissions);
         }
     }];

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

      NSString *birthdaytmp = result[@"birthday"];

      NSLog(@"%@", birthdaytmp);

}];

0 个答案:

没有答案