我要做的是通过事件ID获取事件照片。 我有的代码:
function getFBphoto(event) {
FB.api(
"/"+ event +"/picture?width=500&height=500",
function (response) {
if (response && !response.error) {
console.log(response);
}
}
);}
Facebook仍然为我提供了200px大小的图像,我试图遵循一些建议,并尝试了这种版本的代码:
function getFBphoto(event) {
FB.api(
"/"+ event +"/picture",
{
"redirect": false,
"height": "500",
"type": "normal",
"width": "500"
},
function (response) {
if (response && !response.error) {
console.log(response);
}
}
);}
没有运气,仍然最大200x200px照片,而添加较大的参数仍然不会影响获得更大的照片。
在这两种情况下,fb 的响应示例:
Object {data: Object}
data: Object
height: 50
is_silhouette: false
url: "https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/t1/c114.0.200.200/p200x200/1656179_10201352079056227_1689058768_n.jpg"
width: 50
__proto__: Object
__proto__: Object
问题是:如何使用 API 调用获取事件的实际大小照片(例如:https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/t1/1507953_584284274994290_910086685_n.jpg)。
尝试cover
字段 - 对于您的活动,/471101519656645?fields=cover ->提供此图像。