self.addEventListener("push", (event) => {
  const data = JSON.parse(event.data.text());

  if (data.title && data.body) {
    self.registration.showNotification(data.title, {
      body: data.body,
    });
  }
});
