1
0
mirror of https://github.com/mastodon/documentation synced 2025-04-11 22:56:17 +02:00

Add standard push notifications (#1585)

This commit is contained in:
S1m 2025-03-05 22:02:08 +01:00 committed by GitHub
parent c88771d7a0
commit 7da6e97fcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -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.\

View File

@ -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]
: {{<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.
@ -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,