defold / extension-push

This is a Defold native extension which provides access to Push Notifications functionality on iOs and Android devices.
https://www.defold.com/extension-push/
MIT License
20 stars 16 forks source link

Clear already fired push notifications on Android (DEF-2501) #10

Closed britzl closed 2 years ago

britzl commented 5 years ago

Description: From forums: https://forum.defold.com/t/remove-push-notification-when-app-opens-def-2501/5222

If a game is started from the home screen and later closed/quit, any notifications for that game is still available in the notifications bar/drop down. According to Gulev on the forums, most other games usually clear any pending notifications if the game is started, we should do something similar or provide an API to manually clear them.

Use case: Any "old"/non-relevant notifications should be removed from the notifications bar/dropdown.

Business need: We should align with how other games are using push notifications on Android, having all Defold games leaving old notifications is not "nice" from a user/player standpoint.

mtuprikov-ms commented 2 years ago

Probably we can solve it via NotificationManager.cancel(push_id)

https://stackoverflow.com/questions/2665634/how-to-clear-a-notification-in-android

Here? https://github.com/defold/extension-push/blob/c3e0830e7b4b25041fe6fa328de551258f12213a/extension-push/src/java/com/defold/push/Push.java#L530

britzl commented 2 years ago

Yes, that seems about right I think!

AGulev commented 2 years ago

Solved here https://github.com/defold/extension-push/releases/tag/3.1.0