Created
July 13, 2016 15:41
-
-
Save beverloo/bba38571dafee9c37a2cf867fe5fb562 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener('push', async(e) => { | |
const notification = await fetch(e.data.text()); // payload contains a URL | |
await registration.showNotification(notification.title, { | |
body: notification.body, | |
icon: notification.icon | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment