Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 939
Saugat Bhattarai Avatar asked Oct 30 '22 22:10

Saugat Bhattarai


1 Answers

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.

like image 151
Idel Pivnitskiy Avatar answered Nov 15 '22 16:11

Idel Pivnitskiy