Achievements locked again after a while Google play games

北城以北 提交于 2020-01-07 06:53:08

问题


I had implemented Google Play Games into my app (in beta test). I added some achievements (more than 5) and have done all the related settings like described in the API. I am testing this with the same google account as my developer account, this is added as a test account inside the console. To unlock an achievement I call

  Games.Achievement.unlock(mGoogleApiClient,achievement);

It works and my achievements are unlocked. To call the users Play Games Achievements I use the intent like stated in the api:

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

The user achievements are shown in the Play Games user view, so everything seems to be ok. The strange thing is, after a while, let´s say half an hour, the achievements are in reveal (locked) state again.

I can´t find any hint in the API and Developer Guides, that the achievements are reset automatically in the beta test phase or in an unreleased state. Is this a normal behaviour and it will work after official release or do I miss something anywhere?


回答1:


You may want to try adding the achievementId when you call startActivityForResult.

So, instead of calling

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

use

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

See Unlocking achievements for more information.




回答2:


I found out that it was because I used an unsigned APK. For get the tests work correctly, it must be a release signed apk. I also put the same released version into the alpha test.



来源:https://stackoverflow.com/questions/44505156/achievements-locked-again-after-a-while-google-play-games

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