2016-05-08 13 views
0

我使用此代碼登錄到Facebook的:的Facebook的iOS SDK 4不返回所有數據

[loginManager logInWithReadPermissions:@[@"email", @"public_profile", @"user_birthday", @"user_friends"] 
         fromViewController:self 
           handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { .... }]; 

而這個代碼得到朋友的數據:

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] 
           initWithGraphPath:@"me/invitable_friends" 
           parameters:@{@"fields": @"id, first_name, last_name, birthday, gender, picture, devices"} 
           HTTPMethod:@"GET"]; 
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, 
             id result, 
             NSError *error) { .... }]; 

任何原因,我不得到以下信息:

  • 性別
  • 設備
  • 生日

回答

0

(FBSDK 4.11.0)

我GraphRequest:

NSString *path = [NSString stringWithFormat:@"/me/friends?limit=1000"]; 

FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] 
           initWithGraphPath:path 
           parameters:@{@"fields": @"id, name, link, picture.type(small), birthday, gender, devices"} 
           HTTPMethod:@"GET"]; 

返回數據:

{ 
    devices =  (
       { 
      hardware = iPhone; 
      os = iOS; 
     } 
    ); 
    gender = female; 
    id = 1265683xxxx273xx; 
    link = "https://www.facebook.com/app_scoped_user_id/1265683xxxx273xx/"; 
    name = "Alexandra Szab\U00f3"; 
    picture =  { 
     data =   { 
      "is_silhouette" = 0; 
      url = "https://scontent.xx.fbcdn.net/v/t1.0-1/p50x50/1007501_1223615617667435_678361396224449932_n.jpg?oh=b3c99d05faf1265683xxxx273xx&oe=57C0940"; 
     }; 
    }; 
}