Android - Google play service : Leaderboard, limited number of requests
Asked Answered
T

0

8

It's new and it's sad. Since last Friday, it appears that Google have decided to limit the numbers of queries to the Leaderboard via loadCurrentPlayerLeaderboardScore.

I have a game that requests the access to 4 Leaderboards simultaneously, and since Friday, that's what I am receiving:

11-30 10:12:51.557 12993-12993/? I/LEADERBOARD: Request n0 : STATUS_OK
11-30 10:12:51.597 12993-12993/? I/LEADERBOARD: Request n1 : STATUS_OK
11-30 10:12:51.767 12993-12993/? I/LEADERBOARD: Request n2 : STATUS_OK
11-30 10:12:51.898 12993-12993/? I/LEADERBOARD: Request n3 : STATUS_NETWORK_ERROR_NO_DATA

If I invert the requests order:

11-30 10:30:31.431 12993-12993/? I/LEADERBOARD: Request n2 : STATUS_OK
11-30 10:30:31.642 12993-12993/? I/LEADERBOARD: Request n3 : STATUS_OK
11-30 10:30:31.832 12993-12993/? I/LEADERBOARD: Request n0 : STATUS_OK
11-30 10:30:31.952 12993-12993/? I/LEADERBOARD: Request n1 : STATUS_NETWORK_ERROR_NO_DATA

And finally, if I double the requests:

11-30 10:38:53.521 12993-12993/? I/LEADERBOARD: Request n0 : STATUS_OK
11-30 10:38:53.691 12993-12993/? I/LEADERBOARD: Request n1 : STATUS_OK
11-30 10:38:53.892 12993-12993/? I/LEADERBOARD: Request n2 : STATUS_OK
11-30 10:38:54.022 12993-12993/? I/LEADERBOARD: Request n3 : STATUS_NETWORK_ERROR_NO_DATA
11-30 10:38:55.944 12993-12993/? I/LEADERBOARD: Request n0 : STATUS_NETWORK_ERROR_NO_DATA
11-30 10:38:55.994 12993-12993/? I/LEADERBOARD: Request n1 : STATUS_NETWORK_ERROR_NO_DATA
11-30 10:38:56.084 12993-12993/? I/LEADERBOARD: Request n2 : STATUS_NETWORK_ERROR_NO_DATA
11-30 10:38:56.234 12993-12993/? I/LEADERBOARD: Request n3 : STATUS_NETWORK_ERROR_NO_DATA

Like you can see, only 3 requests are now authorized by Google. The official documentation mentions nothing about that. Any idea how to circumvent this?

Edit : After a couple of tests, I discovered that the limit is about of 3 requests max per +-20 sec.

Turves answered 30/11, 2015 at 10:5 Comment(7)
Most of Google's other APIs have a limit on the number of requests you can make per second. 3 per 20s sounds really low though. Maybe you can try spreading out your requests instead of making them all at one time.Wimbush
Thank you @Andy. The interesting thing is that it was working before. I tried to spread the requests with 10sec between each, it gave me the same result! :o With 15sec between each, the first time everything went fine, but the second time, only the first request worked. I really do not understand. :(Turves
Any news about it? I'm also having the same issue!Rishi
@thiagolr, unfortunately, no. I resigned myself to use only one query at a time. The result : my users have lost some content, and me the opportunity to cross the data. :(Turves
@Denis How did you solved this problem? I'm facing the same issue. #41469291Orozco
@akshaybhange Unfortunately no :(Turves
@Denis I've found a way.. I'm keeping delay of 45 seconds after 2 leaderboard fetch and I'm keeping this whole code in AsyncTask so that even after activity destroy this code will run and will not affect UI..Orozco

© 2022 - 2024 — McMap. All rights reserved.