Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android-gpgs: GpgsClient using deprecated Google APIs #45

Open
karivatj opened this issue Nov 23, 2021 · 1 comment
Open

android-gpgs: GpgsClient using deprecated Google APIs #45

karivatj opened this issue Nov 23, 2021 · 1 comment

Comments

@karivatj
Copy link
Contributor

Hello,

I've been using your library for integrating Google Play Services to my game project, and it has been working fine when I'm running it on desktop (using desktop-gpgs module implementation). Leaderboards work as they should etc. However I noticed that on Android the leaderboards seem to respond with an empty payload even though the leaderboard id is correct, it is published and there are scores in it. I'm not sure if I'm using the library incorrectly or not, but here are my two cents that came to mind.

I downloaded the source code and checked that what's happening when I trigger fetchLeaderboardEntries method. The library is using deprecated Google APIs. For example, Games.Leaderboards.loadTopScores on line 477 of android-gpgs / GpgsClient.java has been deprecated since 2020-11-09. One should migrate to LeaderboardsClient instead.

There were other deprecated method calls within the client also that should be checked. Maybe using these deprecated APIs is causing some issues on android?

Also on another note I noticed that when fetching the leaderboards the timespan of the scores is hardcoded to be ALL_TIME. It would be great if you could specify the timespan yourself (DAILY, WEEKLY, ALL_TIME) so it would be possible to implement daily, weekly and all time leaderboards easily. It would be easy to implement by adding a new argument timespan of type integer in to the mix.

Thanks again for the good library. I'm not sure tho if this project is active anymore but if you could consider refactoring the android gpgs client code to use the up-to-date APIs it would be greatly appreciated.

image

@MrStahlfelge
Copy link
Owner

Feel free to open a PR with the changes. The lib is still maintained, but I usually don't change working code just for the sake of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants