12 lines
314 B
JavaScript
12 lines
314 B
JavaScript
self.addEventListener("activate", event => {
|
|
console.log("Service worker activated");
|
|
});
|
|
|
|
|
|
self.addEventListener('push', (event) => {
|
|
let notification = event.data.text();
|
|
console.log(`got notification: ${notification}`)
|
|
console.log(`evt: `, event)
|
|
self.registration.showNotification(notification);
|
|
});
|