You will receive a heading notification only if you are using some other application when your application is in the background or not working. If your phone is not in use, you will receive a notification about the system tray or a notification about the locked screen.
If you use the application server to send push notifications via the HTTP protocol, you can even set the priority to high in your json data sent to the fcm endpoint.
If you use the firebase console, in the "Advanced notification settings" section, make sure that the priority is high.
High priority ensures that you receive notification notifications in most cases.
EDIT . This is how your edited json should look like a successful test -
{ "to":"push-token", "priority": "high", "notification": { "title": "Test", "body": "Mary sent you a message!", "sound": "default", "icon": "youriconname" } }
youriconname is the name of the resource that you want to set as the notification icon.
I skipped the data for testing purposes. Only this should give you a notice of the heads.
Nishant dubey
source share