Play games loadLeaderboardMetadata() returns outdated data

我们两清 提交于 2019-12-04 03:57:13

问题


I'm working on an app with Play Game Services, and I'm making a custom UI to display the list of leaderboards with only the score and the ranking of the player as dynamic data.

Then, when the user clicks on the score or ranking, he will be taken to the leaderboard default UI to display this particular leaderboard in details.

In other words: I'm making a custom UI for leadeboards list, but I use default UI for displaying a specific leaderboard.

I use loadLeaderboardMetadata() method to get the leaderboards data. The problem is it returns outdated data, even when I use loadLeaderboardMetadata(context, true) to force the reloading of data.

Moreover, if I click on an outdated score to display a specific leaderboard with the default UI, the data here is up to date ! ... and then, if I go back to my list of leaderboards and force the data reload, then the data for this specific leaderboard will be up to date (but not the data for other leaderboards).

Any idea and/or ways to work around that?

Thank you in advance,

Stéphane.


回答1:


I finally found that by using the loadCurrentPlayerLeaderboardScore instead of the loadLeaderboardMetadata method, it seems to work.

Update: Except that this method is really slow if you have 30 leaderboards, and it throws error because you make to much call to the API's, so it is not a viable option. Except if you have very few leaderboards.



来源:https://stackoverflow.com/questions/21216926/play-games-loadleaderboardmetadata-returns-outdated-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!