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