I developed an application that has the function of receiving notifications from the server.
The problem is that when I click on the notification I received, it opens a new instance of my application itself .
This is normal if my application is not in the foreground, but if it is, and I try to open a notification, a new instance of my application is created and, thus, overlaps a previously opened instance of the application.
I do not want this to happen, so when I click on the notification, if my application is in the foreground , I have to close it and open a new instance .
How do I override the notification click event?
source share