-
-
Save hscale/d148391a2b00d7328d88e258162933c7 to your computer and use it in GitHub Desktop.
Service Worker Example
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', function (event) { | |
if (event && event.data) { | |
const data = event.data.json(); | |
event.waitUntil(self.registration.showNotification(data.title, { | |
body: data.body, | |
icon: data.icon || null | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment