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.
Push messaging overview - JavaScript Tutorial
From the course: JavaScript: Progressive Web Applications
Push messaging overview
- [Instructor] The work we've done with notifications has been great, but the chief reason to implement notifications is to reengage users. What we've built so far will only fire a notification when the user runs the PWA, in other words, they're already engaged. What we need is to be able to show notifications to users when the app isn't open. The web push API fits that bill nicely. In general, push notifications work like this, the client accesses the PWA, and it asks the user to allow notifications via the push manager's subscribe method. If the user allows notifications, a subscription object is created. Developers need to store the data in the subscription for sending push messages. An HTTPS Post request, that may or may not originate from the app server, is made to a messaging service that includes data from the subscription. The messaging service sends the push message to the client using data stored in the subscription. If needed, when the message is received, the app is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Introduction to notifications2m 21s
-
(Locked)
Requesting permission to show notifications5m 26s
-
(Locked)
Displaying a notification4m 50s
-
(Locked)
Adding data to a notification4m 36s
-
(Locked)
Closing a notification3m 33s
-
(Locked)
Handling the notification click event11m 25s
-
(Locked)
Push messaging overview1m 24s
-
(Locked)
Adding Firebase Cloud Messaging to the project2m 15s
-
(Locked)
Subscribing to push messaging6m
-
(Locked)
Handling push notifications3m 14s
-
(Locked)
Sending a tickle using cURL4m 57s
-
(Locked)
Sending data in a push message2m 9s
-
(Locked)
Installing Mozilla's Web Push library2m 51s
-
(Locked)
Modifying the push event handler2m 52s
-
(Locked)
Modifying the notification click event3m 48s
-
(Locked)
Creating the web push script6m
-
(Locked)
Testing the hosted app5m 7s
-
(Locked)
-
-