Working with local notifications, the following situation came up:
A local notification is triggered while the app is open.
This places the local notification in the notification center (am testing on android but should be same on iOS).
It also generates a ‘notification’ system event (which I am capturing).
So, when I react to the notification system event, all is well, but it leaves the notification in the notification center, effectively giving me two notifications instead of 1.
Is there any simple way around this?
Simple is NOT:
-
Disabling the reaction to received notifications within the app

-
Creating a unique ID for each notification, placing that in the custom field and also writing it into a save file somewhere, so every time I get a notification within the app I can look up the notification ID and cancel it manually.
The second idea above seems like the only thing that would actually work, but I don’t really want to have to do that, and I sorta feel like I’m missing something somewhere - like maybe the notification event should include the notification ID as well so I can try cancelling it from that, just in case.
