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)) | |
}) |
@bidorboocrew This is exactly the question I have, too. Did you find out where to add this?
you add it to your service worker file in your react code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Jasmina ! I liked your article about using webpush notifications I am just wondering
Where would I add this ?
"self" refers to what in this context