gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 19:41:33 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com