From the course: JavaScript: Progressive Web Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Sending data in a push message

Sending data in a push message - JavaScript Tutorial

From the course: JavaScript: Progressive Web Applications

Start my 1-month free trial

Sending data in a push message

- [Instructor] The use case for our PWA is pretty much fully implemented. The combination of the service worker and push notifications allow us to reengage users whenever we have any new content to show them. And we can send a tickle any time we simply want to be visible again on the user screen. If there's new content, almost certainly we'll want to update the cache to include it. This means we'll need to modify the service worker. If we're gonna do that, we can always modify the notification in the push event handler as the service worker's going to be updated anyway. That way, for example, if we were to implement a new program, we could switch the load property to point to the program's location in the app instead of the info location. There may however be times when you want to send data along with a push message, and then display that data to the user in a notification. The classic example is an email app. You wouldn't want a generic push notification sent. Although that might…

Contents