This commit is contained in:
JonatanRek committed 2020-08-13 10:31:15 +02:00
1 parent 1ba0d7f9ba
commit 8d7722be91
3362 files changed
+13786 -500745

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
self.__precacheManifest = [].concat(self.__precacheManifest || []);
// workbox.setConfig({
// debug: true
// });
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
console.log('Loading SW');
self.addEventListener("push", function (event) {
console.log('Received a push message', event);
if (event.data) {
var data = event.data.json();
console.log(data);
event.waitUntil(self.registration.showNotification(data.notification.title, {
body: data.notification.body,
icon: data.notification.image || null
}));
}
});
self.addEventListener("notificationclick", function (event) {
const promiseChain = clients.openWindow("https://gabenparadise.com/");
event.waitUntil(promiseChain);
});