Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Play Game Service: show unlocked achievement

This might be a stupid question but I havent found an answer to it on Google so its up to you :)

I am using Google Play Service to provide achievements and leaderboards in my android app. I use

unlockAchievement(getResources().getString(R.string.achievement_id));

While the achivement is unlocked correctly and is shown in the achievements list it is NOT shown to the user immediately when its unlocked, i.e. the ""achievement unlocked" thingy like in the screenshot below is not beeing displayed:

enter image description here

Any ideas why this doesn't pop-up?

Thanks in advance!

like image 733
Richard R Avatar asked Dec 22 '13 17:12

Richard R


People also ask

How do you unlock achievements on Google Play?

To unlock an achievement, call the AchievementsClient. unlock() method and pass in the achievement ID.

How do I fix Google Play Games achievements?

Try going in to your settings, go to accounts, go to your Google account and uncheck Google play games and then check it again. See if it syncs the achievements. welcome to android central! Try going in to your settings, go to accounts, go to your google account and uncheck google play games and then check it again.

What is the meaning Achievement unlocked?

Achievement-unlocked definition A goal has been accomplished.

How do you tell if a game has Google Play achievements?

The best way to keep track of them is to use the Google Play Games app for Android. This app is the global window to gaming on mobile. This app will let you see all of the games you have played and view the achievements for them. It will also let you find other games that have support for Google Play Games.


1 Answers

I got it. I used to instanciate the GameClient in my main activity and the referenced it in the game activity. So the unlock popup was bound to the main not the game activity. So I changed

MainActivity.gamesClient.unlockAchievement(...);

to

getGamesClient().unlockAchievement(...);.

And thats it!

like image 132
Richard R Avatar answered Sep 24 '22 05:09

Richard R