简体   繁体   English

列出使用FB.api的响应标记了用户的所有Facebook照片

[英]Listing all the Facebook photos a user is tagged in using response from FB.api

Right now I'm using the Facebook APIs through JavaScript. 现在,我正在通过JavaScript使用Facebook API。 So far I can log myself in, and now I'm trying to get information about a user who logs into my website. 到目前为止,我可以登录自己,现在我正在尝试获取有关登录到我的网站的用户的信息。 Here is what I have so far: 这是我到目前为止的内容:

FB.api('/me/photos', function(response) { console.log(response); } );

However, the response only says: "Object {data: Array[0]}", and the Array is empty. 但是,响应仅显示:“对象{data:Array [0]}”,并且Array为空。

I've also tried using this code: 我也尝试使用此代码:

FB.api('/me?fields=photos', function(response) { console.log(response); } );

The response I get from the console is: "Object {id: "10152784292783838"}". 我从控制台获得的响应是​​:“对象{id:” 10152784292783838“}”。

How can I get all the photo information? 如何获取所有照片信息? The only ideas I thought of are that I'm not using an access token, but when I tried that it still didn't work. 我想到的唯一想法是我没有使用访问令牌,但是当我尝试访问令牌时仍然无法使用。 I'm also including 'user_photos' in my scope when I log the user in, but it doesn't change the response. 当我登录用户时,我还将“ user_photos”包括在我的范围内,但不会更改响应。 What am I doing wrong? 我究竟做错了什么?

As long as you're using the app's admin/tester/developer users, you should be able to get the data. 只要您使用该应用程序的admin / tester / developer用户,就应该能够获取数据。 If not, the array will be empty, because facebook requires an app review for apps which request more than the basic permissions. 如果不是,则该数组将为空,因为facebook要求对超出基本权限的应用程序进行应用程序审查。

See 看到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM