Skip to content

Instantly share code, notes, and snippets.

@mciastek
Created January 29, 2017 13:14
Show Gist options
  • Select an option

  • Save mciastek/6b66c2b7a542d0f1acebbf1b7b35d91a to your computer and use it in GitHub Desktop.

Select an option

Save mciastek/6b66c2b7a542d0f1acebbf1b7b35d91a to your computer and use it in GitHub Desktop.
self.addEventListener('push', (event) => {
const title = 'New notification';
const body = 'We have received a push notification.';
const icon = '/app-icon-192.png';
const tag = 'push-notification-tag';
event.waitUntil(
self.registration.showNotification(title, {
body,
icon,
tag
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment