简体   繁体   中英

How to reset achievements in Google Play Games?

I made changes to the amount of XP which is gained by an achievement. Now I want to reset the achievements for users, so that their XP will be reset. It is currently too much. New achievements will reward the new XP, but the old XP is still visible in Google Play Games.

I tried to follow this guide for my developer account, and it didn't work: https://developers.google.com/games/services/management/api/achievements/resetAll

It resulted in { instead of the result listed on the page.

Any ideas?

This feature seems to be available only for draft achievements.

See: https://developers.google.com/games/services/management/api/achievements

After a few tests, I realized a possible issue. First of all, there is a reset button on every achievement inside the developer console. You can just reset an achievement by pressing this button. But the following requirements must be fulfilled:

  1. it has to be a release signed apk which is installed for testing.
  2. The app must be in alpha or beta test phase, using the same version of app that you have installed for testing (not rellay sure about that)
  3. The Play Games settings for your app shouldn´t be published. You can only reset achievements for test users with an unpublished game. With game I mean the play games settings, not the app itself.

After pressing the reset, it needs long time to reset, in my test it needed about 1 hour, but maybe could be longer or shorter.

But there is a little issue, I think it´s on Googles site and I reported it to Google. The reset doesn´t work on incremental achievements.

I was having issues with resetting and modifying draft achievements, no matter what changes I made to the Google Play Console the achievements on the Android client were never updated. Incremental achievements did not reset, adding achievements did not show up in client, etc.

However, I eventually discovered that running

startActivityForResult(Games.Achievements.getAchievementsIntent(mGoogleApiClient), REQUEST_ACHIEVEMENTS);

to display all achievement progress does seem to refresh the client properly. So now it works to reset and update achievements, as long as I start the achievements intent in the application afterwards.

Just adding this comment in case someone else runs into the same problem as me.

Edit: it seems like I also need to run increment on one or more achievements before it gets refreshed. In either case it is still an improvement, as it was not working at all before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM