Facebook Login Graph API返回错误的个人资料图片网址 [英] Facebook Login Graph API returns wrong profile picture URL
问题描述
我正在使用Facebook图形API,通过调用 https://graph.facebook.com/v2.10/me?access_token=xxxxxxxxxxxxxxxxxx& fields = id,email,name,first_name,last_name,gender,age_range,picture.width(512).height(512),locale,link,timezone,updated_time ,返回我期待的json响应。这样的东西:
I'm using Facebook graph API by calling https://graph.facebook.com/v2.10/me?access_token=xxxxxxxxxxxxxxxxxx&fields=id,email,name,first_name,last_name,gender,age_range,picture.width(512).height(512),locale,link,timezone,updated_time which returns the json response I was expecting. Something like this:
{
"id": "1234567890987654321",
"email": "xxxxxx\u0040example.com",
"name": "xxxx xxxx",
"first_name": "xxxx",
"last_name": "xxxx",
"gender": "xxxxx",
"age_range": {
"min": 21
},
"picture": {
"data": {
"height": 720,
"is_silhouette": false,
"url": "https://scontent.fna.fbcdn.net/v/t1.0-1/p720x720/xxx.jpg?oh=xxx",
"width": 720
}
},
"locale": "en_US",
"link": "https://www.facebook.com/app_scoped_user_id/1234567890987654321/",
"timezone": xx,
"updated_time": "2017-05-24T14:00:01+0000"
}
但是,在调用 url
图片
的子节点,没有返回任何内容。我复制了实际链接并将其粘贴到Google Chrome浏览器中,然后返回 DNS_PROBE_FINISHED_NXDOMAIN
错误。
However, on calling the url
child node of the picture
, nothing was returned. I copied the actual link and paste it in Google Chrome browser and DNS_PROBE_FINISHED_NXDOMAIN
error is returned.
我查看了图像我注意到这是一个不同的基本网址: https://scontent.fjnb2-1 .fna.fbcdn.net ,而我正在指向 https://scontent.fna.fbcdn。净。图表上返回的网址缺少 .fjnb2-1
,它可以在我添加它时起作用。
I checked the image used by the Facebook website, I noticed that it's pointing to a different base url: https://scontent.fjnb2-1.fna.fbcdn.net, while mine is pointing to https://scontent.fna.fbcdn.net. The returned url on graph is missing .fjnb2-1
and it works when I added it.
这是一个Facebook Graph API上的已知错误?
Is this a known bug on Facebook Graph API?
是否可以更改基本网址以包含缺少的部分?
Is it ok to change the base url to include the missing part?
任何其他方法来解决这个问题,而不会再遇到另一个问题,当Facebook决定改变返回URL?
Any other way to fix this issue without running into another issue later when Facebook decided to change the return url?
推荐答案
这是许多开发人员已经 https://developers.facebook.com/bugs已经报告了一个已知错误a>我相信Facebook团队正在努力解决这个问题。
This is a known bug which has already been reported by many developers on https://developers.facebook.com/bugs and I believe the Facebook team is working on resolving this.
我可以确认这个问题已经由Facebook开发团队解决了。
I can confirm that this issue has been resolved by Facebook Dev Team now.
这篇关于Facebook Login Graph API返回错误的个人资料图片网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!