Only foreground receives:
{
"to": "the device token"
"notification": {
"title":"New Notification!",
"body":"Test"
},
"priority":10
}
For background handling:
{
"to": "the device token"
"data": {
"title":"New Notification!",
"body":"Test"
},
"priority":10
}
- How to handle notification when app in background in Firebase
- https://wajahatkarim.com/2018/05/firebase-notifications-in-background--foreground-in-android/
- https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app
- https://documentation.onesignal.com/docs/data-notifications#2-notification-payload-data