如何在Facebook Graph PHP SDK中下载当前用户的所有照片?

我正在尝试使用Facebook PHP SDK查找当前用户被标记的所有照片.当我查询$fb-> get(‘/ me / photos?type = tagged& limit = 10000’)时,当我以我身份登录时,列表中只有大约500张照片.如果我查看Facebook网页,它说我有超过3000张照片.是否可以获得当前用户的所有照片? 最佳答案 希望这个摘要可以节省一些时间,因为我花了几天时间对此嗤之以鼻.从Graph API v2.5开始,您的应用无权查看其他人上传过的照片,除非上传者已登录应用并授予了user_photos权限.这甚至适用于当前用户已被标记的照片.

为了让应用通过图谱API获取您标记的所有照片,您上传了标记的照片的所有朋友都必须向该应用授予权限.

引用Facebook支持:

After checking, this should be the case. Each Facebook user is in
control of what data is accessible to an application. If you have that
user grant the user_photos (and possibly user_posts if it’s the
container for the photo) to the application, you should be able to
fetch that photo.

资料来源:Facebook API Bug Report

点赞