With FCM I receive push notifications in the system tray when the app is in the background or not running. When the app is in the foreground I can override onMessageReceived and create my own heads-up notification with NotificationCompat
.
Is there a way to create a heads-up notification when my app is in the background or not running?
Thanks
EDIT: For reference here is the message payload I am using via curl to https://fcm.googleapis.com/fcm/send
{
"to":"push-token",
"content_available": true,
"priority": "high",
"notification": {
"title": "Test",
"body": "Mary sent you a message!",
"sound": "default"
},
"data": {
"message": "Mary sent you a Message!",
"notificationKey":"userID/notification_type",
"priority": "high",
"sound": "default"
}
}