Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard push notifications #1585

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions content/en/entities/WebPushSubscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ aliases: [
{
"id": 328183,
"endpoint": "https://yourdomain.example/listener",
"standard": true,
"alerts": {
"follow": false,
"favourite": false,
Expand Down Expand Up @@ -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.\
Expand Down
9 changes: 8 additions & 1 deletion content/en/methods/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -66,6 +67,9 @@ subscription[keys][p256dh]
subscription[keys][auth]
: {{<required>}} 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.

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -157,6 +162,7 @@ Authorization
{
"id": 328183,
"endpoint": "https://yourdomain.example/listener",
"standard": true,
"alerts": {
"follow": true,
"favourite": true,
Expand Down Expand Up @@ -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,
Expand Down