Is there a way to hide a GCM push notification?

Hi everyone,

Is there a way to hide a GCM push notification?
 

We are developing a game in which you can challenge another friend. 

If app is opened, is there a possibility to “catch” this push notification, proccess it inmediately on the app and hide it from the user?
So custom data in push message is proccesed directly from the app without user interaction?

Any ideas?

Thank you.

Anyone?  :unsure:

Generally speaking if the app is open, the app should receive the notification and it should not show up in the push tray.

If you have a notification event handler set up, it will trigger and you can process the event in-app. You should only get push notifications on device if the app is backgrounded or not running. If you interact with the device’s push notification, if your app was backgrounded, it will be brought to the foreground and will receive the notification event. If you’re app was stopped, it will get a cold start, in which case the notification will come in as launchArgs.

Rob

This is not my case, i’m developing and android app. If i open the app on the device, and send a push. App receives push notification data, i can process it normally, but a notification stays on the notification bar.

how can i handle it?

User can later click on the notification, causing a “double processing” of the same push message.

Engineering confirms that the behavior on Android is to not consume the push. You may not want to deal with the push. Normally you should be able to consume the push and clear it. Corona can’t clear an individual push, but it can clear all of them.

Call:

system.cancelNotification()

with no arguments.

Rob

Anyone?  :unsure:

Generally speaking if the app is open, the app should receive the notification and it should not show up in the push tray.

If you have a notification event handler set up, it will trigger and you can process the event in-app. You should only get push notifications on device if the app is backgrounded or not running. If you interact with the device’s push notification, if your app was backgrounded, it will be brought to the foreground and will receive the notification event. If you’re app was stopped, it will get a cold start, in which case the notification will come in as launchArgs.

Rob

This is not my case, i’m developing and android app. If i open the app on the device, and send a push. App receives push notification data, i can process it normally, but a notification stays on the notification bar.

how can i handle it?

User can later click on the notification, causing a “double processing” of the same push message.

Engineering confirms that the behavior on Android is to not consume the push. You may not want to deal with the push. Normally you should be able to consume the push and clear it. Corona can’t clear an individual push, but it can clear all of them.

Call:

system.cancelNotification()

with no arguments.

Rob