Android: How to reset score from Google Play Games leaderboards

Android: How to reset score from Google Play Games leaderboards

Recently I had to work with Leaderboards and scores for our new game QuickAZ. So while I was developing and testing the game, my scores were registered to Leaderboards, which was a good thing :D.

RESET THE SCORE BEFORE PUBLISHING

But, before publishing the game, I wanted to reset my score. In this phase is pretty easy to reset the score. You have to open your Google Play Developer Console – Go to Game Services – Select Leaderboards – Select Your Leaderboard – click the button labeled “Delete” at the bottom of the page.

RESET THE SCORE AFTER PUBLISHING

Well, in this phase, the reset is not so straightforward. After I published my game, I started fixing a few bugs and I did something that altered my score, so I needed to delete it from Leaderboards. I spent a lot of time searching on the internet how to do that and in the end I found this solution that I hope will help you guys to save some time.

1. Tools needed

2. Link your app

You have to have your app linked to OAuth 2.0 Playground. In order to do that you just have to make sure that you have your email in the TEST list in the Game Services from Developer Console and after that, follow the steps from this tutorial.

3. Reset score request 

Now that you have your app linked, and learned from the previous tutorial how to use playground, you just have to get your Leaderboard id from  Google Play Developer Console and add the following request in the OAuth 2.0 Playground page:

get leaderboard id

POST https://www.googleapis.com/games/v1management/leaderboards/leaderboardId/scores/reset

E.g.

POST https://www.googleapis.com/games/v1management/leaderboards/Cfk65GCgfj8/scores/reset

reset leaderboard score

The above example will reset all scores for the leaderboard with the given ID for the currently authenticated player. For more types of reset requests visit https://developers.google.com/games/services/management/api/scores

After you send the request you can open your leaderboards from your app and you will notice that your score has disappeared.

I hope this tutorial will help you!

, , , , , , ,
Previous Post
Google Play Games API + Playground
Next Post
Android ExpandableList Move Item From Group to Another on Click

Related Posts

Menu