Created
January 29, 2018 03:27
-
-
Save jasminabasurita/4eb79155958058397d5c77d0f6f0264f 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", event => { | |
const data = event.data.json() | |
const { title } = data | |
const body = { | |
body: data.body, | |
icon: data.icon | |
} | |
event.waitUntil(self.registration.showNotification(title, body)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you add it to your service worker file in your react code