meteor - Facebook 好友列表为空

标签 meteor facebook-javascript-sdk facebook-friends

所以我使用“Facebook-sdk”插件。我正在这样初始化 Facebook:

FB.init({ appId: 'xxxxxxxxxxx', cookie: true, xfbml: true, oauth: true, status: true });

    FB.login(function(){ // get permissions
    }, {scope: 'user_friends, read_friendlists, user_photos, email, publish_actions  '});

    FB.getLoginStatus(function (response) { // to generate AccessToken
      if (response.authResponse) {
        console.log('LoginStatusResponse: ' + JSON.stringify(response, null, 4));
      } else {
        console.log('AuthResponse: No');
      }
    });

然后,为了响应按钮单击事件,我正在执行以下操作:

'click #get_fb_friends' : function(event, template) {

    FB.api( 
      "/me/friends",
      function (response) {
        if (response && !response.error) {
          console.log('GOT them !!!' + JSON.stringify(response, null, 4));
          return response;
        } else {
          console.log('No can do' + JSON.stringify(response, null, 4));
        }
      });
  }

问题是我得到了一个空的数据变量:

GOT them !!!{
    "data": []
} 

PS:查询"/me"会返回有关我自己的所有信息,"/me/friends"不起作用。

可能是权限问题吗?

最佳答案

Facebook 几周前更改了其 api,只有当您的好友亲自同意使用您的应用程序时,您才能访问他们的列表。对此无能为力

关于meteor - Facebook 好友列表为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23723978/

相关文章:

javascript - Meteor:从错误响应中获取数据?

meteor 、 Apollo 和 Sequelize : Cannot find module 'config.json'

facebook - 通过 facebook graph api 创建事件

php - 使用 facebook API PHP SDK v5.1 交友

iphone - 加载 Facebook 好友到 UITableView

javascript - 是否可以(使用 Meteor)控制何时将发布推送到订阅的客户端?

javascript - Meteor更新收集错误

javascript - 请求通过营销 API 在 Facebook 推广 iOS 应用程序

javascript - 您如何处理 FB.getLoginStatus() 等 Facebook SDK 函数的错误?

facebook - 给 friend 发私信