Facebook API - Get Friends and Sort By Date Befriended (Added/Accepted)
I need to know how I can get a full list of the current logged in users friends list in the order that they became friends on Facebook. So for example, if I just became friends with John Doe, then he would be the first person listed in the JSON array. If my very first friend was Jane Doe, then she would be very last on the list.
I am using the Facebook Javascript API for getting the friends list:
FB.api('/me/friends', { access_token: response.session.access_token }, function(data){
// Some Code Here.
});
But I could also do something like:
$.ajax({ url:'php/fbfriends.php', data:{ access_token: response.session.ac开发者_开发知识库cess_token }, method:'POST', dataType:'json', success:function(data){
// Some Code Here.
});
Where it calls my local server, and PHP does some manipulation to the Facebook Graph Call.
You cannot retrieve friends by date-added, Facebook does not allow that. You could try to parse the user's wall though to see if you can extract friend adding trough that, but it wouldn't be trough the API.
精彩评论