空的朋友阵列在facebook open graph api v2 [英] empty friends array in facebook open graph api v2

查看:118
本文介绍了空的朋友阵列在facebook open graph api v2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Facebook的OG api v2中列出我的朋友。如果我在这里使用浏览器:



https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends&version=v2.0



我可以得到我的朋友,但是如果我编程该应用程序并进行json调用:

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

friends数组响应是一个空对象。



我正在使用Facebook登录按钮:

 < fb:login-button scope = public_profile,email,user_about_me,user_birthday,user_education_history,user_hometown,user_location,user_relationships,user_relationship_details,user_photos,user_friends,read_friendlistsonlogin =checkLoginState();> 
< / fb:login-button>

我可以访问很多关于我自己的其他数据,但不是朋友。任何想法我失踪了?

解决方案

Facebook最近改变了很多事情,为了隐私,您只能获得现在也在使用App的朋友。参见这里:





另请参见:好友列表不在强大的access_token 之后,t可以再工作了。


I'm trying to pull a list of my friends in Facebook's OG api v2. If I use the explorer here:

https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends&version=v2.0

I can get my friends, but if I program the app and make a json call:

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

The friends array response is an empty object.

I'm using the facebook login button:

<fb:login-button scope="public_profile,email,user_about_me,user_birthday,user_education_history,user_hometown,user_location,user_relationships,user_relationship_details,user_photos,user_friends,read_friendlists" onlogin="checkLoginState();">
  </fb:login-button>

and I can access a lot of other data about myself, but not friends. Any idea what I'm missing?

解决方案

Facebook changed a lot of things recently, for privacy reasons you can only get the friends who are also using the App now. See here:

Also see here: Friendslist doesn't work anymore after the powerful access_token

这篇关于空的朋友阵列在facebook open graph api v2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆