push
Subscribe to and receive push notifications when a server-side notification is received, via the Web Push API
Web Push API
CounterSocial natively supports the Web Push API. You can utilize the same mechanisms for your native app. It requires running a proxy server that connects to Android???s and Apple???s proprietary notification gateways. However, the proxy server does not have access to the contents of the notifications. For a reference, see Mozilla???s web push server, or more practically, see:
postSubscribe to push notifications
Add a Web Push API subscription to receive notifications. Each access token can have one push subscription. If you create a new subscription, the old subscription is deleted.
Returns: PushSubscription
OAuth: User token + push
Version history:
2.4.0 - added
Request
Headers
string
Form Data Parameters
string
string
prime256v1
curve.string
boolean
boolean
boolean
boolean
boolean
Response
200: Success
A new PushSubscription has been generated, which will send the requested alerts to your endpoint.
{
"id": 328183,
"endpoint": "https://yourdomain.example/listener",
"alerts": {
"follow": true,
"favourite": true,
"reblog": true,
"mention": true,
"poll": true
},
"server_key": "BCk-QqERU0q-CfYZjcuB6lnyyOYfJ2AifKqfeGIm7Z-HiTU5T9eTG5GxVA0_OH5mMlI4UkkDTpaZwozy0TzdZ2M="
}