0
votes

I recently posted a question Facebook Connect - get users friends score on how to get your friends high scores for your app. What I found was the following:

1) /me/friends with user_friends permissions to get friends with app installed and who have accepted this permission. 2) loop through /{friendID}/scores to get their high score.

I have not tested this fully as there are only 2 accounts with the app installed so I have the following question:

im using /me/friends?limit=10 as I only want the top ten high scores. Does this automatically bring back the highest or is there another parameter that needs setting to accomplish this?

any information would be appreciated.

edit Just found that /me/friends?fields=score,picture will return the all the data in one request. Just need to find out how to get the friends with the highest score

regards

1
The Graph API has no parameters for sorting the results, so I highly doubt that the results are in a certain order.Tobi

1 Answers

0
votes

If you call:

https://graph.facebook.com/{app_id}/scores

It will actually return the scores for all your friends in descending order as you would like. When I do this for my application, I see:

{
  "data": [
    {
      "user": {
        "id": "111", 
        "name": "..."
      }, 
      "score": 830, 
      "application": {
        …
      }
    }, 
    {
      "user": {
        "id": "222", 
        "name": "..."
      }, 
      "score": 330, 
      "application": {
        …
      }
    }, 
    {
      "user": {
        "id": "333", 
        "name": "..."
      }, 
      "score": 220, 
      "application": {
        …
      }
    },
    ...
  ]
}