Handling push notifications

After the consumer has confirmed a push notification subscription, you can send messages to the user agent. When a message is sent to the device, it determines what service worker to apply the message and trigger a push event.

The service worker needs a push event handler that receives an event parameter. The event object contains the message data.

The sever can send any text in the message. It is up to the service worker to parse the message and trigger the appropriate work flow.

PodStr only manages a new podcast's episode notifications. But a retailer might want to promote sales or remind a customer to complete an order. There is really no limit to what prompt you might send to your customer.

The latter message ...

Get Progressive Web Application Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.