jquery-facebook-multi-friend-selector
jquery-facebook-multi-friend-selector copied to clipboard
Get names as well as ID's?
When running getSelectedIds() you only get the ID's. Is it possible to somehow get the names as well?
^need a similar solution
This was a while ago now but I think I ended up doing something like this:
var selectedFriends = $('#jfmfs-container').data('jfmfs').getSelectedIds(),
friendsWithIdAndName = [];
for ( var i = 0, len = selectedFriends.length; i < len; i += 1 ) {
FB.api({
method: 'fql.query',
query: 'SELECT uid, first_name, last_name FROM user WHERE uid=' + selectedFriends[i]
}, function(response) {
return friendsWithIdAndName.push(response[0]);
}
}
i.e. querying the FB API for each ID to get a name back and push to a new array. Probably not the best solution but it did the trick for me.