Search code examples
javascriptgoogle-play-servicesleaderboard

Get user scores from all google leaderboards


I have a game with multiple level, I setup a leaderboard for each level, now I want to get the score of a user for all levels.

I can get the score for one level using get API of google services, but I am having issue with multiple leaderboards.

I tried to do that with for loop but I am facing "Rate Limit Exceeded" issue (It seems to be due to the multiple fast requests the for loop is sending).

How can I get all scores?

Ps: I tried with setTimeout, always facing the same problem (Sometimes it retrieves datas but often not).


Solution

  • Regarding Rate Limit Exceeded error, based from this documentation, you will see errors in your callback handlers or listeners when your game exceeds its rate limit. To request for additional quota for your application, click the Request more link next to your app's quota entry in the Google API Console. Please be aware, however, that requests for additional games quota probably will not be honored unless your game is experiencing truly exceptional usage and is obeying these best practices.

    Also, the suggested action from this related SO post is to look at keeping a database of scores yourself, vs. using leaderboards as a datastore. Something like Firebase Realtime Database might be more appropriate.