You need to create your own notification developer in your application. more details here: https://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomExpandedView , I need so long to learn how to make firebase call onMessageReceived in all cases.
- foreground application
- application in the background
- The application was killed.
basically your message for firebase via api should not contain a “ notification ” in your json request for the firebase server and use only “ data ”, as shown below, the firebase service will call your onMessageReceived in all cases listed above.
{ "to": "/topics/your_topic", "data": { "key1":"data_key1", "title":"", "line1":"data1", "line2":"data2" } }
source share