PushSubscription
The PushSubscription
interface of the Push API provides a subcription's URL endpoint and allows unsubscription from a push service.
Documentation PushSubscription by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
endpoint: String
A USVString
containing the endpoint associated with the push subscription.
options: PushSubscriptionOptions
An object containing the options used to create the subscription.
getKey(name: PushEncryptionKeyName): js.lib.ArrayBuffer
Returns an ArrayBuffer
which contains the client's public key, which can then be sent to a server and used in encrypting push message data.
Name | Type |
---|---|
name |
PushEncryptionKeyName |
Returns |
---|
js.lib.ArrayBuffer |
unsubscribe(): js.lib.Promise<Bool>
Starts the asynchronous process of unsubscribing from the push service, returning a Promise
that resolves to a Boolean
when the current subscription is successfully unregistered.
Returns |
---|
js.lib.Promise<Bool> |
toJSON(): PushSubscriptionJSON
Standard serializer — returns a JSON representation of the subscription properties.
Returns |
---|
PushSubscriptionJSON |
new(initDict: PushSubscriptionInit): Void
Name | Type |
---|---|
initDict |
PushSubscriptionInit |