The background handler is not working: no matter what I do, the sw always use the regular onMessage, displaying the actual notification I sent instead of the custom one set on the handler.
My code is the exact same as the one in the repo:
messaging.setBackgroundMessageHandler(function(payload) {
console.log('[firebase-messaging-sw.js] Received background message ', payload);
// Customize notification here
const notificationTitle = 'Background Message Title';
const notificationOptions = {
body: 'Background Message body.',
icon: '/Content/Img/logo-amezze-120.png'
};
return self.registration.showNotification(notificationTitle,
notificationOptions);
});
The background handler is not working: no matter what I do, the sw always use the regular onMessage, displaying the actual notification I sent instead of the custom one set on the handler.
My code is the exact same as the one in the repo: