From 12de3dec4f281cd2795b59f28498f260fb06415c Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 27 Aug 2023 11:58:02 -0600 Subject: [PATCH] take a stab at the meaning of the "options" in the web-push doc --- web-push.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/web-push.md b/web-push.md index 041f749..c0eb253 100644 --- a/web-push.md +++ b/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 `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` object containing details of the subscription, such as the endpoint URL and the 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 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 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