您可以使用friendListrespectivename and id FBGraph API一起获得,如下所示:

  FbGraphResponse *fb_graph_response = [fbgraph doGraphGet:@"/me/friends" withGetVars:nil];


但是如何使用name, id and picture获取all friendsFBGraph API

最佳答案

您可以使用friendListname, id and picture与相应的FBGraph API一起获得,如下所示:

NSDictionary *param=[NSDictionary dictionaryWithObjectsAndKeys:@"picture,name",@"fields", nil];

FbGraphResponse *fb_graph_response = [fbgraph doGraphGet:@"/me/friends" withGetVars:param];


Response将是

data = {
   id = 100001625299089;
   name = "Name here";
   picture = {
              data = {
                      s_silhouette" = 0;
                      url = "url here";
                      };
              };
 },
    //all other friends here
 }


编辑:您可以loactionbirthdayFBGraph API Documentation中列出的许多other fields

只需在上面的代码中更改param dictionary

 NSDictionary *param=[NSDictionary dictionaryWithObjectsAndKeys:@"picture,name,location,birthday",@"fields", nil];

关于iphone - iOS:使用FBGraph API获取FriendList以及相应的名称,ID和图片,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14257549/

10-11 23:47