How to handle the notifications in Android while using both data and notification message?

Viewed 29

In my current app notifications are displayed by the FCM automatically as I am using notification message. Now I need to use Data message so that I can handle notifications myself, when the app is in background. The problem here is that if

  1. I send only data message current version of the app will not show the notifications(as I am not sending notification message)
  2. I send both notification and data message then I cannot handle notifications as when the app will be background FCM will automatically display the message based on notification data.

Is there any way so that I can use Data message without breaking the current app functionality and will be able to handle the notifications by myself?

0 Answers
Related