Firebase Cloud Messaging has two types of messages: notification messages and data messages.
Data messages are used for delivering data to your app. They are always delivered to your application's onMessage
handler.
Notification messages are used to show a notification to the user. When your app is active, the messages are delivered to its onMessage
handler, so that you can display the notification inside the app. But when the app is not active, notification messages are handled by the system and not delivered to your app's onMessage
handler.
It sounds like you're sending a notification message. If you always want the message to be delivered to your applications onMessage
, you should send a data message instead.
Also see: