朋友和朋友列表在Facebook [英] Friends and Friendlists in Facebook
问题描述
我如何知道一个朋友是否在使用JS SDK的aquaintances或好朋友或另一个自定义friend_list。我使用单页javascript应用程序在phonegap。
主要的问题是,我需要不同的数据集,在回调函数之外是不可用的。 p>
我试图查询所有的朋友列表,如:
api('me / friendlists'){
});
我所有的朋友都喜欢这样
FB.api('me / friends',function(friends){
friends.data.forEach(function(friend){
});
});
但是他们都使用回调函数,我需要比较2个结果并添加一个属性listname和/
使用 read_friendlists
href =https://developers.facebook.com/docs/authentication/permissions/ =nofollow>权限您可以访问用户的朋友列表。
然后,调用 / [USER_ID] / friendlists
获取朋友列表List ids,然后调用 / [FRIEND LIST ID]
以获取该列表上的朋友列表。
然后,您可以存储这些,并检查特定的uid是否在列表
How do I find out if a friend is in for example the aquaintances or good friends or another custom friend_list with the JS SDK. Im working with a singlepage javascript application in phonegap.
The main issue is that I need different sets of data, that aren't useable outside of the callback function.
I tried to query all my friend lists like so,
FB.api('me/friendlists'){
});
And all my friends like so
FB.api('me/friends', function(friends){
friends.data.forEach(function(friend){
});
});
but they both use callback functions, i need to compare the 2 results and add a property listname and/or id to the friends result.
With the read_friendlists
Permission you can access a user's friends lists.
Then, make a call to /[USER_ID]/friendlists
to get the friend list List ids, then a call to /[FRIEND LIST ID]
to get the list of friends on that list.
You can then store those and check if a specific uid is on one of the lists
这篇关于朋友和朋友列表在Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!