我正在创建一个iPhone应用程序,我必须在其中显示带有图像的好友列表。 我正在使用Facebook图形API。我正在获取朋友的身份和姓名,但不是图片。 所以请建议我如何得到这个?
答案 0 :(得分:1)
写一个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; } {},{}等
希望这有帮助!