我目前正在使用以下代码从用户个人资料中检索所有照片
FB.api('/me/albums?fields=id,name', function(response) {
//console.log(response.data.length);
for (var i = 0; i < response.data.length; i++) {
var album = response.data[i];
FB.api('/' + album.id + '/photos', function(photos) {
if (photos && photos.data && photos.data.length) {
for (var j = 0; j < photos.data.length; j++) {
var photo = photos.data[j];
// photo.picture contain the link to picture
var image = document.createElement('img');
image.src = photo.picture;
document.body.appendChild(image);
image.className = "border";
image.onclick = function() {
//this.parentNode.removeChild(this);
document.getElementById(info.id).src = this.src;
document.getElementById(info.id).style.width = "220px";
document.getElementById(info.id).style.height = "126px";
};
}
}
});
}
});
但是,它返回的照片质量很差,基本上就像缩略图一样。如何从相册中检索更大的照片。
通常对于个人资料图片,我使用 ?type=large 返回一个不错的个人资料图片
但是 type=large 不适用于相册中的照片,并且一旦我指定照片网址,是否有办法从 facebook 获取 zip 格式的照片,因为我希望用户能够下载照片。