iOS Facebook图形API配置文件图片链接
我正在尝试检索到个人资料图片的链接。。。 到目前为止,graph API调用:iOS Facebook图形API配置文件图片链接,ios,facebook,facebook-graph-api,profile,image,Ios,Facebook,Facebook Graph Api,Profile,Image,我正在尝试检索到个人资料图片的链接。。。 到目前为止,graph API调用: [facebook requestWithGraphPath:@"me/picture" andDelegate:self]; 将图像本身作为数据返回。当我打电话时: [facebook requestWithGraphPath:@"me/picture" andDelegate:self]; 我确实得到了一组图片,其中每个图片都有链接。 无论如何,有没有类似的东西为个人资料图片,至少只是链接。。。还是不可能?
[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
将图像本身作为数据返回。当我打电话时:
[facebook requestWithGraphPath:@"me/picture" andDelegate:self];
我确实得到了一组图片,其中每个图片都有链接。
无论如何,有没有类似的东西为个人资料图片,至少只是链接。。。还是不可能?
如果有人已经经历过这个,请让我知道
干杯
萨米。你遇到过类似以下的事情吗
NSString *fbuid = @"1234567890";
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/picture", fbuid]];
或者您需要上面的链接将您重定向到的最终url吗?对于最终的url,我想你可能需要一个代理
更新:您还可以获取FQL的链接:
发出图形请求:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"picture",@"fields",nil];
[facebook requestWithGraphPath:@"me" andParams:params andDelegate:self];
然后根据请求加载:
NSString *pictureUrl = [result objectForKey:@"picture"];
如果需要其他字段,只需将它们添加到params字典:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"id,name,picture",@"fields",nil];
登录后,您可以通过此链接获取个人资料图片
https://graph.facebook.com/userId/picture?width=640&height=640
如何指定要返回的图像的大小?