Browse Source

take a stab at the meaning of the "options" in the web-push doc

kb/add-usage-guide
Trent Larson 1 year ago
parent
commit
12de3dec4f
  1. 20
      web-push.md

20
web-push.md

@ -225,6 +225,16 @@ export function toUint8Array(base64String: string, atobFn: typeof atob): Uint8Ar
The options object is of type `PushSubscriptionOptions`, which includes the The options object is of type `PushSubscriptionOptions`, which includes the
`userVisibleOnly` and `applicationServerKey` (ie VAPID public key) properties. `userVisibleOnly` and `applicationServerKey` (ie VAPID public key) properties.
options: An object that contains the options used for creating the
subscription. This object itself has the following sub-properties:
applicationServerKey: A public key your push service uses for application
server identification. This is normally a Uint8Array.
userVisibleOnly: A boolean value indicating that the push messages that
are sent should be made visible to the user through a notification.
This is often set to true.
The subscribe() method returns a `Promise` that resolves to a `PushSubscription` The subscribe() method returns a `Promise` that resolves to a `PushSubscription`
object containing details of the subscription, such as the endpoint URL and the object containing details of the subscription, such as the endpoint URL and the
public key. The returned data would have a form like this: public key. The returned data would have a form like this:
@ -246,16 +256,6 @@ public key. The returned data would have a form like this:
representing the subscription's expiration time in milliseconds since representing the subscription's expiration time in milliseconds since
01 January, 1970 UTC. This can be null if the subscription never expires. 01 January, 1970 UTC. This can be null if the subscription never expires.
options: An object that contains the options used for creating the
subscription. This object itself has the following sub-properties:
applicationServerKey: A public key your push service uses for application
server identification. This is normally a Uint8Array.
userVisibleOnly: A boolean value indicating that the push messages that
are sent should be made visible to the user through a notification.
This is often set to true.
The BROWSER will, internally, then use that URL to check for incoming messages The BROWSER will, internally, then use that URL to check for incoming messages
by way of the service worker we described earlier. The BROWSER also sends this by way of the service worker we described earlier. The BROWSER also sends this
URL back to SERVICE which will use that URL to send messages to the BROWSER via URL back to SERVICE which will use that URL to send messages to the BROWSER via

Loading…
Cancel
Save