Remove push notification when app opens (DEF-2501)

I have next case:

  • for example I have few notifications in my bar (notification already received by user).
  • user starts app using icon on desktop (not from notification).
  • when user close application - the notifications still in notification-bar.

I checked few other games (some of them send really many notifications). And all of them remove all recieved notifications when I opened the app.

In my defold game I try to use
push.cancel

But it has no effect to already recieved notifications.

How I can to remove already recieved notifications from notification-bar when application starts?

UPD: I checked this issue only on android

2 Likes

Hmm, I thought maybe we had a ticket for this in our issue tracker, but I couldn’t find one. @sven is the man when it comes to push notifications. @sven, can you provide some input here?

1 Like

Hi!

Currently there is no way from inside Defold to cancel notifications that has been displayed (you should be able to cancel any pending notifications with push.cancel however). But as you pointed out, if other games usually clear this list if when the game is started, we should look into having similar functionality. I’m adding an issue for this: DEF-2501

2 Likes