Push Notifications
self.addEventListener('push', async function (event) {
if (!(self.Notification && self.Notification.permission === 'granted')) {
return;
}
const {title, options}= event.data.json();
event.waitUntil(self.registration.showNotification(title, options));
});Last updated
Was this helpful?