Search code examples
workbox

Workbox - Push and Push Notifications?


Looking over the documentation for workbox.js, I am not seeing any documentation for push or push notifications.

Does workbox offer push functionality? I am speaking of the client side, not server side. Mainly subscriptions and invoking the notification api.

And if not, how would I would need to write that service worker manually. How would I integrate a manual written service worker into a existing workbox implementation?


Solution

  • You don't need Workbox to implement push notifications. It can be implemented directly via the ServiceWorker APIs.

    You can find some good examples here:

    https://serviceworke.rs/push-get-payload_service-worker_doc.html

    Also note: The Push API is not currently supported on Safari : Push API

    Good luck !