Skip to content

Push notifications in the Aria app

APIs and apps 2 min read Source on codefloe

On this page

Aria (the cross-platform Misskey-family client) sets up push notifications by showing an AiScript snippet and telling you to open your server's Scratchpad page (https://your-server/scratchpad), paste the snippet, run it, and paste the JSON answer back into Aria.

That step does not work on Catodon: the Scratchpad was removed in 26.5.0, together with the rest of AiScript support, so /scratchpad no longer exists. Push notifications themselves still work. What follows registers the same device Aria wanted to register, by calling the same endpoint its snippet called, from the API console instead.

What Aria's snippet does

The generated code is a thin wrapper over one authenticated API call:

{
  "endpoint": "<value Aria shows>",
  "auth": "<value Aria shows>",
  "publickey": "<value Aria shows>"
}

called as sw/register in the browser session, whose answer looks like:

{
  "state": "subscribed",
  "key": "<server key>",
  "userId": "<your account id>",
  "endpoint": "<the same endpoint>",
  "sendReadMessage": false
}

Aria checks that userId is the account you are setting up and that endpoint is the one it generated, then keeps the answer. "state": "already-subscribed" is fine too: it means this device was already registered and nothing further is needed.

Register the device from the API console

Do this in a desktop browser. The API console needs a mouse and keyboard; the values are long strings that are painful to retype on a phone.

  1. In Aria, start enabling push notifications until it shows the code. Leave that dialog open. Copy the three values out of it: endpoint, auth and publickey.

  2. In the browser, sign in to the same server as the same account you are setting up in Aria. This matters: the call registers the device for whoever is signed in, and Aria refuses an answer whose userId is someone else.

  3. Open the API console: https://your-server/api-console.

  4. In the Endpoint field, type sw/register. The params box fills in.

  5. Replace the params with the values from Aria, for example:

    {
      "endpoint": "https://push.example.net/abc123...",
      "auth": "def456...",
      "publickey": "ghi789..."
    }

    Two optional fields may be added: "sendReadMessage": true behaves like Settings > Notifications > Delete push notifications once they have been read, and "deviceName": "Aria on iOS" labels the row in Settings > Notifications > Registered devices. Neither is required.

  6. Leave With credential on and press Send.

  7. Copy the whole JSON response from the Response box and paste it into Aria's answer field, then confirm. Check that endpoint in the answer is the endpoint from step 1; if Aria complains about the endpoint or the account, you pasted an answer for a different device or signed the browser in as a different account.

If it fails

  • UNKNOWN_API_ENDPOINT, or the params box does not fill in for sw/register: you typed the endpoint name wrongly.
  • INVALID_ENDPOINT: the endpoint Aria generated was refused. It must be an https URL with no embedded credentials. Try generating it again in Aria.
  • CREDENTIAL_REQUIRED or a sign-in prompt: the browser session expired. Sign in again and retry. The endpoint is rate-limited (2 calls per second); waiting a moment and sending once more is enough.
  • Aria says the answer is for the wrong account or endpoint: the browser was signed in as a different account than the one in Aria, or the params came from a different Aria dialog. Redo the steps with one dialog and one account.

Notes

  • Browser push notifications are unaffected: Settings > Notifications > Enable push notifications in the web client works as before.
  • This is a workaround for Aria's setup flow, which still assumes every server has a Scratchpad. The lasting fix belongs in Aria: it already holds the account's token and could call sw/register itself instead of routing through pasted AiScript.