The PushManager
interface of the Push API provides a way to receive notifications from third-party servers as well as request URLs for push notifications.
Documentation PushManager by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
Constructor
Methods
getSubscription():Promise<PushSubscription>
Retrieves an existing push subscription. It returns a Promise
that resolves to a PushSubscription
object containing details of an existing subscription. If no existing subscription exists, this resolves to a null
value.
Throws:
null | DOMError |
---|
permissionState(?options:Null<PushSubscriptionOptionsInit>):Promise<PushPermissionState>
Returns a Promise
that resolves to the permission state of the current PushManager
, which will be one of 'granted'
, 'denied'
, or 'prompt'
.
Throws:
null | DOMError |
---|
subscribe(?options:Null<PushSubscriptionOptionsInit>):Promise<PushSubscription>
Subscribes to a push service. It returns a Promise
that resolves to a PushSubscription
object containing details of a push subscription. A new push subscription is created if the current service worker does not have an existing subscription.
Throws:
null | DOMError |
---|