简体   繁体   English

Facebook javascript API一次可以为用户提供一张照片

[英]Facebook javascript API get users photos one at the time

Hello i am trying to get the users tagged photos one at the time with javascript. 您好,我正在尝试让用户一次用javascript标记照片。

Here is how i call it: 这是我的称呼:

 FB.api('/me?fields=name,picture.type(large),photos.limit(2).type(tagged)', function(response) {
  play(response.name, response.picture.data.url, response.photos.data.source);
   ....

And how i use them: 以及我如何使用它们:

 use:  {url: "some url....", params: ['name','fb','photo1', 'photo2']},

The thing is that when i call this i get "Cannot read property 'data' of undefined " 问题是,当我调用此命令时,我得到“无法读取未定义的属性'data'”

on the photos.limit(2).type(tagged) 在photos.limit(2).type(tagged)上

The other things work great. 其他事情也很好。 Name and profile pic. 名称和个人资料图片。

Any ideas? 有任何想法吗?

Perhaps i need to sort the results from photos.limit(2).type(tagged) or something but i have no clue o how to do that... 也许我需要对photos.limit(2).type(tagged)之类的结果进行排序,但是我不知道该怎么做...

Any help will be awesome. 任何帮助都会很棒。

Thanx 谢谢

Sounds like you aren't getting any data from the photos endpoint. 听起来您没有从照片端点获取任何数据。

Ensure that you have user_photos permission in 确保您在中具有user_photos权限

 FB.login(function(response) {
   // handle the response
 }, {scope: 'user_photos'});

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

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