From 8c9ab37749a4b02541e308b5cefc5baed4376455 Mon Sep 17 00:00:00 2001 From: sim Date: Thu, 9 Jan 2025 16:07:33 +0100 Subject: [PATCH] Add standard push notifications --- content/en/entities/WebPushSubscription.md | 8 ++++++++ content/en/methods/push.md | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/content/en/entities/WebPushSubscription.md b/content/en/entities/WebPushSubscription.md index f639c726f..e103a5462 100644 --- a/content/en/entities/WebPushSubscription.md +++ b/content/en/entities/WebPushSubscription.md @@ -22,6 +22,7 @@ aliases: [ { "id": 328183, "endpoint": "https://yourdomain.example/listener", + "standard": true, "alerts": { "follow": false, "favourite": false, @@ -49,6 +50,13 @@ aliases: [ **Version history:**\ 2.4.0 - added +### `standard` {#standard} + +**Description:** If the push messages follow the standardized specifications (RFC8030+RFC8291+RFC8292). Else they follow a legacy version of the specifications (4th draft of RFC8291 and 1st draft of RFC8292). +**Type:** Boolean +**Version history:**\ +4.4.0 - added + ### `server_key` {#server_key} **Description:** The streaming server's VAPID key.\ diff --git a/content/en/methods/push.md b/content/en/methods/push.md index ebd617556..31385c40e 100644 --- a/content/en/methods/push.md +++ b/content/en/methods/push.md @@ -46,7 +46,8 @@ Add a Web Push API subscription to receive notifications. Each access token can 3.4.0 - added `data[policy]`\ 3.5.0 - added `data[alerts][update]` and `data[alerts][admin.sign_up]`\ 4.0.0 - added `data[alerts][admin.report]`\ -4.3.0 - added stricter request parameter validation, invalid endpoint URLs and subscription keys will now result in an error, previously these would be accepted, but silently fail. +4.3.0 - added stricter request parameter validation, invalid endpoint URLs and subscription keys will now result in an error, previously these would be accepted, but silently fail.\ +4.4.0 - added `subscription[standard]` #### Request @@ -66,6 +67,9 @@ subscription[keys][p256dh] subscription[keys][auth] : {{}} String. Auth secret. Base64 encoded string of 16 bytes of random data. +subscription[standard] +: Boolean. Follow standardized webpush (RFC8030+RFC8291+RFC8292) ? Else follow legacy webpush (unpublished version, 4th draft of RFC8291 and 1st draft of RFC8292). Defaults to false. + data[alerts][mention] : Boolean. Receive mention notifications? Defaults to false. @@ -108,6 +112,7 @@ A new PushSubscription has been generated, which will send the requested alerts { "id": 328183, "endpoint": "https://yourdomain.example/listener", + "standard": true, "alerts": { "follow": true, "favourite": true, @@ -157,6 +162,7 @@ Authorization { "id": 328183, "endpoint": "https://yourdomain.example/listener", + "standard": true, "alerts": { "follow": true, "favourite": true, @@ -258,6 +264,7 @@ Updating a PushSubscription to only receive mention alerts { "id": 328183, "endpoint": "https://yourdomain.example/listener", + "standard": true, "alerts": { "follow": false, "favourite": false,