I have switched over to using FCM for my application. When my app is open, I handle the messages manually and if the Fragment which contains the message list isn't displayed, then I have the code display a Notification. To display the Notification I use the function:
public void notify(int id, Notification notification)
The problem I am encountering is if my application is in the background, FCM displays a Notification. I even set the tag parameter on the server so only one Notification will be displayed for the application. If the user opens the application without clicking on the Notification, and then received a message, a separate Notification is displayed, which is not what I want. I switched to using the function:
public void notify(String tag, int id, Notification notification)
And using the same tag as the server uses for the FCM message still produces a second notification. Is there a way the Notification I create programmatically can replace the Notification created by FCM?