How to GetUserRanking for time

0 votes


If best score is the lowest time. How can I get user ranking?

For instance: 

User1 = 90 seconds

User2 = 60 seconds

User3 = 120 seconds


When I call scoreBoardService.GetUserRanking (gameName, "User3",  callback);

callback return rank = 1 and should be rank = 3


PS: I tried meta headers by calling setOtherMetaHeaders API on scoreboardService setting orderByAscending as key and score as value and it didn't work :(

related to an answer for: Get top 10 score time
asked Aug 1, 2014 in App42 Cloud API-BaaS by alissonsalin (30 points)

1 Answer

0 votes
Best answer

orderByAscending header is not supported for this method yet. It is under development and will take few weeks to hit the production.

Alternatively, you can save the remaining time instead of played time. For example if you have time out in your game of 300 seconds, and if user has taken 30 seconds to complete, you can save 270 seconds as remaining time in leaderboard. In this case the user who has highest remaining time would be a top ranker in default leaderboard.

Let me know if it helps in solving your query.

answered Aug 1, 2014 by ajay123 (899 points)
selected Aug 2, 2014 by alissonsalin
Thank you! I'll wait for a new release.
For now I'm saving score in negative seconds:

User1 = -90 seconds
User2 = -60 seconds
User 3=-120 seconds

scoreBoardService.GetUserRanking (gameName, "User3",  callback);

callback return rank = 3 now :)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on