将 Facebook 个人资料图片放入 UIImage
我尝试通过调用 me/picture
或
从 Graph API 获取个人资料图片。然而,给出的响应似乎不是 JSON 响应。我无法读取响应,但我知道它应该是链接到个人资料图片 JPEG 文件的另一个 URL。
我知道一旦获得该 URL,我就可以使用 UIImage
方法 imageFromURL
(或类似的方法),但我只是不确定如何处理响应。有人可以帮忙吗?
I'm trying to get a profile picture from Graph API by calling me/picture
or <friend_id>/picture
. However it seems that the response that's given is not a JSON response. I haven't been able to read the response, but I know it's suppose to be another URL that links to the profile picture JPEG file.
I know that once I get that URL I can use UIImage
method imageFromURL
(or something like that) but I'm just not sure how to process the response. Can someone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一样发出请求
您可以像您的响应处理程序
You can make request like
and your response handler
也许这会对你有帮助:
如何从 iPhone 应用程序中使用 Facebook 的新 Graph API 获取用户个人资料
Mayb this would help you:
How To Get a User Profile with Facebook’s New Graph API from your iPhone App
如果您想要 URL 而不是图像数据,请在此处查看我的答案:iOS Facebook Graph API 个人资料图片链接
If you want the URL and not the image data, then see my answer here: iOS Facebook Graph API Profile picture link