iphone - 如何在 Facebook 中获取好友个人资料图片

标签 iphone facebook-graph-api

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/

相关文章:

iphone - 我应该如何处理 Objective-C 中同一个委托(delegate)的多个回调的需要?

ios - 数组计数的 UITableView 问题

iphone - 你能用 NSPredicate 指定 "select unique name from ..."吗?

java - 从 Facebook 墙阅读的应用程序

php - Facebook PHP SDK : Upload Event Cover Photo

iphone - Google Analytics(分析)中关于我的 iPhone 应用程序的绝对独立访问者是多少?

iOS 7 popViewController 动画向上移动整个 View

php - 如何使用 Facebook API 获取用户的辅助电子邮件地址

java - Facebook 图形 API。应用程序通知 : A client gets notification, 但服务器在响应中收到错误:不支持的发布请求

node.js - AWS lambda 无法调用 Facebook SDK