美文网首页
FACEBOOK获取用户性别,邮箱问题

FACEBOOK获取用户性别,邮箱问题

作者: bobociel | 来源:发表于2018-03-12 12:18 被阅读175次

http://blog.csdn.net/ioscircleandcircle/article/details/75088203

//获取用户信息 picture用户头像  
- (void)getUserInfoWithResult:(FBSDKLoginManagerLoginResult *)result  
{  
    NSDictionary*params= @{@"fields":@"id,name,email,age_range,first_name,last_name,link,gender,locale,picture,timezone,updated_time,verified"};  
      
    FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]  
                                  initWithGraphPath:result.token.userID  
                                  parameters:params  
                                  HTTPMethod:@"GET"];  
    [request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {  
                        NSLog(@"%@",result);  
        /* 
         { 
         "age_range" =     { 
         min = 21; 
         }; 
         "first_name" = "\U6dd1\U5a1f"; 
         gender = female; 
         id = 320561731689112; 
         "last_name" = "\U6f58"; 
         link = "https://www.facebook.com/app_scoped_user_id/320561731689112/"; 
         locale = "zh_CN"; 
         name = "\U6f58\U6dd1\U5a1f"; 
         picture =     { 
         data =         { 
         "is_silhouette" = 0; 
         url = "https://fb-s-c-a.akamaihd.net/h-ak-fbx/v/t1.0-1/p50x50/18157158_290358084709477_3057447496862917877_n.jpg?oh=01ba6b3a5190122f3959a3f4ed553ae8&oe=5A0ADBF5&__gda__=1509731522_7a226b0977470e13b2611f970b6e2719"; 
         }; 
         }; 
         timezone = 8; 
         "updated_time" = "2017-04-29T07:54:31+0000"; 
         verified = 1; 
         } 
         */  
    }];  
} 

相关文章

网友评论

      本文标题:FACEBOOK获取用户性别,邮箱问题

      本文链接:https://www.haomeiwen.com/subject/jjdnfftx.html