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_friendlistsPermission you can access a user’s friends lists.Then, make a call to
/[USER_ID]/friendliststo 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