PushManager
PushManager is a browser API that manages push subscriptions for a Service Worker. It is exposed on a ServiceWorkerRegistration object as pushManager and provides methods to subscribe for push messages, retrieve an existing subscription, or manage the lifecycle of a subscription. Subscriptions created through PushManager enable servers to deliver notifications to users via the Web Push protocol.
The primary method is subscribe(options), which returns a Promise that resolves to a PushSubscription. The options
The another method, getSubscription(), returns a Promise that resolves to the current PushSubscription or null if
PushManager also enables unsubscribing via the PushSubscription object, by calling unsubscribe(), which returns a Promise that
In practice, the server uses the endpoint and keys from the PushSubscription to send messages to the