- Home /
Facebook API: How to get all app users scores
I cannot find out how to get scores for all users for an App. Meaning not just only the user's friends' score. The idea is to get a top 10 scores from all users of the app.
How can I do this?
Answer by carrollh · Feb 06, 2015 at 02:09 AM
EDIT EDIT: Signs point to no. Look at http://stackoverflow.com/questions/7881661/getting-all-users-scores-using-the-facebook-score-api
And after reading the Scores API and similar on fb I found this
https://developers.facebook.com/docs/games/scores
and this https://developers.facebook.com/docs/games/mobile/android-tutorial
which heavily imply that you have to create a leaderboard (and users must be asked for their permission to post to it, at least on Android) before you can get what you want.
EDIT to address Facebook API: Is FB hosting all your data? My game just uses FB tokens for authentication, and all of my data is stored in a Windows Azure mobile services / SQL database. I'm not sure you can do what you want with the limited FB api. I'll keep digging and edit this when I find something.
This completely depends on how the database is set up. There is no way to give you this answer without a lot more detail. I mean from a database table you could simply ask for all users sorted by score (provided you have access to that). But the language and means are completely different between platforms. The SQL-like cases would look something like this:
SELECT * FROM Users ORDER BY Score DESC;
But that is a really expensive function. And you have to set everything up on server side to allow for that.