10 lines
277 B
JavaScript
10 lines
277 B
JavaScript
self.addEventListener('push', function (event) {
|
|
if (!event.data) return;
|
|
const data = event.data.json();
|
|
|
|
const title = data.title || "Discord";
|
|
const options = { body: data.body };
|
|
|
|
event.waitUntil(self.registration.showNotification(title, options));
|
|
});
|