Search code examples
javaandroidfirebasepush-notificationfirebase-cloud-messaging

Android FirebaseMessagingService is not called when app is in background


In Android, I am using firebase notification service for push notification. The message need to modify/amend with custom data and will display to the user. I am doing it in onMessageReceived() as in below link

Firebase notification Sample

I can able to get messages and amend it if the data message content only (shd not include notification payload) when app is in foreground or background.

Android notification issue

Is there any possibility/alternative way to modify the messages with notification and data payload info? Thanks in advance


Solution

  • It can be achieved by using Data message only. Avoid notification payload.