self.addEventListener('push', function(e) {
    self.skipWaiting();
    const message = e.data.json(); // 1
    console.log(message);
    const options = { // 2
      body: message.body,
      title: message.title,
      data: message.data
    };
  
    e.waitUntil(self.registration.showNotification(message.title, options)); // 3
    self.addEventListener('notificationclick', function(e) {
        console.log('Notification click Received.', e.notification.data);
      
        e.notification.close(); // 1
        e.waitUntil(clients.openWindow('https://p2share.me:3000/reciever.html?room='+e.notification.data)); // 2
      });
});