PWA Push Notifications Part 5: send notifications to Android, Windows, Linux & MacOS

Опубликовано: 03 Март 2026
на канале: kaos josh
133
0

Join me as I integrate push notifications -- one of the many things I'll have to do to create my PWA.
Series
Part 1 --    • PWA Push Notifications -- send notificatio...  
Part 2 --    • PWA Push Notifications Part 2  -- send not...  
Part 3 --    • PWA Push Notifications Part 3: send notifi...  
Part 4 --    • PWA Push Notifications Part 4: send notifi...  
Playlist --
   • PWA Push Notifications Part 5: send notifi...  

Part 5

Plan
1. implement listener in service worker
2. retest

Things left undone in the series
This is not production ready. 4 things I will do before production
1. Error handling
2. Subscription data will be saved to user info in DB
3. Restrict Routes
4. Basic Unit Tests
5. Make sure I'm levering all part of of notification content needed: headers, tags, etc, image?

Links
[service worker event listener](https://developers.google.com/web/fun...)


Timestamps
0:45 Begin implementing `push` event listener
2:17 First implementation (simplest)
5:42 Second implementation (lets see a notification!)
10:10 Momentarily stuck with caching issue
11:43 Push Notification, show yourself!
12:15 Product-related considerations

Of note:
6:30 Discussion of `self` in ServiceWorker