Reputation: 2686
I want to send background push notifications to web browsers using Firebase. The push notifications are received, but the notification is not understood by Chrome. Instead of showing the actual title and body, the message "This site has been updated in the background." appears. What am I doing wrong?
My service worker is an empty file.
Code in Cloud Function using the Admin API:
var res = await admin.messaging().send({
"notification": {
"title": "Background Message Title",
"body": "Background message body"
},
"topic":"Test"
});
Upvotes: 1
Views: 1499
Reputation: 11
Because your service worker is empty file you don't handle message
event and browser is displaying default message.
Upvotes: 1