Featured Products

TOP
0 Items
self.addEventListener('push', function(event) { const payload = event.data.json(); const notification = payload.data; const notificationTitle = notification['title']; let notificationOptions = { body: notification['body'], } if (event.data) { notificationOptions.icon = notification['icon'] notificationOptions.data = { click_action: notification['click_action'] }; } event.waitUntil( self.registration.showNotification(notificationTitle, notificationOptions) ); }); self.addEventListener('notificationclick', function(event) { event.notification.close(); var url = event.notification.data.click_action; if(url) { event.waitUntil( clients.openWindow(url) ); } });