iOS Facebook Graph API个人资料图片链接 [英] iOS Facebook Graph API Profile picture link

查看:87
本文介绍了iOS Facebook Graph API个人资料图片链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检索到个人资料图片的链接...
到目前为止,图形API调用:

I am trying to retrieve the link to the profile picture... So far the graph API call :

[facebook requestWithGraphPath:@"me/picture" andDelegate:self];

将图像本身作为数据返回。当我打电话时:

returns the image itself as Data. When I make the call :

[facebook requestWithGraphPath:@"me/picture" andDelegate:self];

我得到一个图片的数组,其中每个都有链接。
有没有得到一些类似的东西为配置文件的图片,至少只是链接...或是不可能吗?
如果有人已经通过,请让我知道。

I do get an array of picture with the link for each of them. Is there anyway to get some sort of similar thing for the profile pic, at least just the link... Or is it not possible? If someone has already been through this please let me know.

干杯,

萨米。

推荐答案

使图表请求:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"picture",@"fields",nil];
[facebook requestWithGraphPath:@"me" andParams:params andDelegate:self];

然后根据请求didLoad:

then on request didLoad:

NSString *pictureUrl = [result objectForKey:@"picture"];

如果您需要其他字段,只需将它们添加到params字典:

If you want additional fields, just add them to the params dictionary:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"id,name,picture",@"fields",nil];

这篇关于iOS Facebook Graph API个人资料图片链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆