在facebook中使用图形api的朋友的个人资料照片(缩略图)

时间:2011-08-16 08:00:39

标签: iphone facebook facebook-graph-api

在表视图中加载我的好友列表并异步加载他们的profile-pic缩略图有一个简单的问题。我只是想不出缩略图的正确网址。任何人都可以用朋友的显示图片的网址帮助我

1 个答案:

答案 0 :(得分:2)

写一个FQL以获取Facebook好友列表&他们的照片

 NSString *query = @"SELECT uid,name,first_name,last_name,pic_square FROM user WHERE uid IN (";
query = [query stringByAppendingFormat:@"SELECT uid2 FROM friend WHERE uid1 = %@)",userid];
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                query, @"query",
                                nil];
[_facebook requestWithMethodName: @"fql.query" 
                       andParams: params
                   andHttpMethod: @"POST" 
                     andDelegate:self]; 

你将获得一个数组

  -(void)request:(FBRequest *)request didLoad:(id)result 

样品       {         “first_name”=用户;         “last_name”= R;         name =“用户R”;         “pic_square”=“https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/.jpg”;         uid = 595sd1;          }      {},{}等

希望这有帮助!