FB_Graph_Response = [FB_Graph doGraphGet:@"me/friends" withGetVars:nil];
// NSLog(@"%@",[FB_Graph_Response.htmlResponse JSONValue]);
arrFriendsList = [[[FB_Graph_Response.htmlResponse JSONValue]objectForKey:@"data"]retain];
我已经使用 fb graph api(上述请求)访问了我的应用程序中的好友列表, 但我无法获取 friend 的个人资料图片。如何获得?
最佳答案
获取用户的id(或昵称),并从https://graph.facebook.com/idOrNick/picture获取图片
这无需任何身份验证即可工作。
小样本:
NSString id = getTheIdOrNick;
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture", id]];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [UIImage imageWithData:data];
//UIImageView *imgView = [[UIImageView alloc]init];
//imgView.image = image;
关于iphone - 如何在 Facebook 中获取好友个人资料图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11360896/