ku4es-notification v1.0.20
ku4es-notification
kodmunki utilities for EcmaScript Notifications
Usage
- Start server:
npm run start
- Navigate to: https://local.notification.server:8444
- Request Permission. Then, subscribe.
- Copy the
auth
,endpoint
, andp256dh
into their appropriate places in the target./send/*.sh
file. - Run your target
./send/*.sh
. It should successfully generate a notification. - Stop server:
npm run stop
Next steps: 1. Set up a manifest so that you can get notifications when chrome is not open. 2. Set up APN so can get notifications on iOS 3. Set up GCM ID so can get notifications on legacy Chrome
Set Up Device
iOS
iOS does require some more steps than the traditional set up
1. In Safari Settings Advanced Features turn on Push API
2. In Safari Settings Advanced Features turn on Notifications.
3. In your manifest.json add "display": "standalone",
to the root of the manifest
(Note: notifications only work on iPhone when the user has added the PWA to their home screen)
Resources
- (Push API W3 Specification)https://www.w3.org/TR/push-api/
- (Subscribing a user)https://web.dev/push-notifications-subscribing-a-user/
- (Web Push Docs)https://github.com/web-push-libs/web-push
- (Medium Article)https://medium.com/commencis/web-push-notifications-with-service-workers-cf6ec8005a6c
- (Safari Push Notifications)https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html
https://web.dev/push-notifications-subscribing-a-user/ https://github.com/web-push-libs/web-push https://developer.chrome.com/blog/push-notifications-on-the-open-web/ https://medium.com/commencis/web-push-notifications-with-service-workers-cf6ec8005a6c https://web.dev/learn/pwa/web-app-manifest/ https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html#//apple_ref/doc/uid/TP40013225-CH3-SW1 https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/NotificationProgrammingGuideForWebsites/PushNotifications/PushNotifications.html