Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unlock achievement in google play games silently, without showing notification

I'm using google play services, achievements in my android game (it's actually unity, but doesn't matter).

To unlock achievement I use plugin which calls unlock(GoogleApiClient apiClient, String id) method. When achievements are set as completed, google shows its own notification, like this: notification.

I need to unlock achievement silently, without showing this notification. Is there anything to hide it?

like image 211
Rustam Ganeyev Avatar asked Mar 13 '14 10:03

Rustam Ganeyev


1 Answers

For anyone else who wants an answer for this:

When you build your GoogleApiClient using new GoogleApiClient.Builder(this) you are giving Game Services an activity with which it can show notifications. If you change the context you pass into the builder to be the application context, rather than an activity, you shouldn't get any notifications.

like image 131
Zurvæ Avatar answered Oct 10 '22 07:10

Zurvæ