ku4es-notification
TypeScript icon, indicating that this package has built-in type declarations

1.0.20 • Public • Published

ku4es-notification

kodmunki utilities for EcmaScript Notifications

Usage

  1. Start server: npm run start
  2. Navigate to: https://local.notification.server:8444
  3. Request Permission. Then, subscribe.
  4. Copy the auth, endpoint, and p256dh into their appropriate places in the target ./send/*.sh file.
  5. Run your target ./send/*.sh. It should successfully generate a notification.
  6. 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

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

Readme

Keywords

none

Package Sidebar

Install

npm i ku4es-notification

Weekly Downloads

0

Version

1.0.20

License

SEE LICENSE IN FILE

Unpacked Size

312 kB

Total Files

13

Last publish

Collaborators

  • kodmunki