facebook oauth,没有基本权限的图片 [英] facebook oauth, no picture with basic permissions
问题描述
我正在使用oauth将Facebook用户登录到我的应用程序.我正在使用FB帐户和基本权限范围进行测试. Facebook的文档说,我应该能够获得具有基本权限的图片",但是当我使用API访问它时,我的帐户没有图片"属性.虽然有名字,姓氏等.
I'm using oauth to log facebook users in to my app. I'm testing with my FB account and with the basic permissions scope. Facebook docs say that I should be able to get 'picture' with basic permissions, but my account has no 'picture' property when I access it with the API. First name, last name, etc. are there though.
这是因为我的帐户无法公开查看吗?为什么会发生这种情况?我肯定有个人资料图片.
Is this because my account is not publicly viewable? Why might this happen? I definitely have a profile picture attached.
这是我的fb链接: http://www.facebook.com/josh.nankin
推荐答案
最好的方法是保留基本权限,并在单独的步骤中触发对图像的请求.通过这种方式询问图形API:
best way is to keep the basic permissions and fire the request for the image in a separate step. Ask the graph api in this way:
https://graph.facebook.com/[fb_user_id]?fields=picture.type(small)
大图:
https://graph.facebook.com/[fb_user_id]?fields=picture.type(large)
您将收到一个类似JSON的响应:
You will get a JSON response like:
{
"id": "100001XXXXXXXXX",
"picture": {
"data": {
"url": "http://profile.ak.fbcdn.net/hprofile-XXXX/41524_1000018XXX51507_XXXX3_q.jpg",
"is_silhouette": false
}
}
}
这篇关于facebook oauth,没有基本权限的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!