7

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!

Richard R
  • 873
  • 6
  • 20
  • (1) Is the achievement already unlocked? The UI will only fire the first time, when the achievement actually unlocks from the locked state, not at subsequent requests. (2) Are you sure the achievement_id is correct? – addaon Dec 22 '13 at 18:42
  • Hi addaon. (1) I checked this and created a new achievement just for testing. When unlocked, the newly created achievement is not displayed but unlocked and is listed as unlocked in the achievement list on Google Play when I display it. So (2) yes, the ID is correctly submitted to Google Play. Is it possible that the popup does not show up on testing? I am testing on a real device with a real Google Plus account though. – Richard R Dec 23 '13 at 09:59
  • Are you setting the view for popups to be something other than the default? – Bruno Oliveira Jan 07 '14 at 23:33

1 Answers1

6

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!

Richard R
  • 873
  • 6
  • 20