简体   繁体   English

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

[英]profile pic(thumbnail) of friends using graph api in facebook

Have a simple problem to load my friend list in table view and asynchronously load their profile-pic thumbnails.有一个简单的问题是在表格视图中加载我的朋友列表并异步加载他们的个人资料图片缩略图。 I just couldn't figure out the correct url for the thumbnail image.我只是想不出缩略图的正确 url。 could anyone help me out with the url of the display pic of friends任何人都可以帮我解决朋友的显示图片的 url

Write a FQL to get list of facebook friends & their Pics编写 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]; 

you will get a array in u r您将在 u r 中获得一个数组

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

Sample { "first_name" =User;示例 { "first_name" =User; "last_name" = R; “姓氏” = R; name = "User R";名称=“用户R”; "pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/.jpg"; "pic_square" = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-ash2/.jpg"; uid = 595sd1; uid = 595sd1; } {},{} etc } {},{} ETC

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM