Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / GCM push notifications shown even when app is running (and how I added sound and LED flash)

Author
Message
Naphier
8
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 11th Dec 2013 19:33
Hi everyone.
I've got the push notifications set up for our game and they are sent and received just fine, but I'd like them to behave a bit more like common apps. I was also able to add a default sound and set the LED to flash. To do so simply add the following to GCMIntentService.java in onMessage() before the line "notificationManager.notify(0,notify)":


Next what I'd like to do is prevent the notification from being shown in the status bar if the game is running in the foreground, because my app itself handles a message for the same event that caused the notification (i.e. it's your turn).

It doesn't look like this is set by the Notification class.
I've been searching all morning and haven't had a bit of luck with it.
Can anyone help?
Thanks

Login to post a reply

Server time is: 2019-08-23 22:48:43
Your offset time is: 2019-08-23 22:48:43