从Facebook api获取朋友列表数据 [英] Fetching Friend list data from Facebook api

查看:122
本文介绍了从Facebook api获取朋友列表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为facebook已经根据v2.2升级了api版本,否则将不会使用fql查询
我想要获取用户的friendlist(只是名字和birthdate),而使用

  FB.api(/ me / friends,function(response){
if(response&&!response.error) {
/ *处理结果* /
console.log(响应);
}
}
);

}



现在从上面的代码,它给我只有没有朋友在count变量,但在数组的数据变量是空白的。

解决方案

你不能再让所有的朋友了,只有那些也使用相同的应用此外,由于引入了Graph API v2.0,所有朋友_ * 权限已被删除。








/ me / friends 返回还在使用您的应用程序的用户的朋友
在v2.0中,朋友API端点返回还在使用您的应用的人的朋友的列表。在v1.0中,回应包括一个人的朋友。



Since facebook has upgraded their api version according to v2.2 no fql query will be use I want to fetch friendlist of user (just name and birthdate) but while fetching the data using

 FB.api("/me/friends",function (response) {
            if (response && !response.error) {
                /* handle the result */
                console.log(response);
            }
        }
    );

}

now from above code its giving me only no of friends in count variable but in array of data variable is blank.

解决方案

You're not able to get all friends anymore, only the friends which are also using the same app. Furthermore, since the introduction of the Graph API v2.0, all friends_* permissions have been removed.

See

/me/friends returns the user's friends who are also using your app In v2.0, the friends API endpoint returns the list of a person's friends who are also using your app. In v1.0, the response included all of a person's friends.

这篇关于从Facebook api获取朋友列表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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