Saugat Bhattarai
Saugat Bhattarai

Reputation: 2750

Relationship between serviceworker and web push message

I am currently working on push notification in browser and I got stuck while handling push message. I am confused about how to relate push messages and service worker to receive the message and pop up in the browser.

I am somewhat clear with the idea of service worker but I am still confused how to relate this with push message and throw in the browser? If anybody has clear idea about such project I am happy to hear it. I have my workflow diagram please go through it, if there is anything you can suggest by looking at this: Web Push Notification Workflow (wolfpusher)

Upvotes: 5

Views: 2053

Answers (1)

Idel Pivnitskiy
Idel Pivnitskiy

Reputation: 1057

Service worker works as a "daemon" inside the web browser, which receives new push messages from the Push Service and triggers desktop notifications for them. Here is a sequence diagram which explains the whole process: enter image description here

For more details, read original Push API specification.

Upvotes: 2

Related Questions