Push payloads
The exact payload every transport carries, and how to open the app from a notification.
If you are writing a client — a service worker, an app, anything pointed at notify — this is the contract. The same fields on every transport, differing only in how the transport can carry them.
| Field | Meaning |
|---|---|
id | The message id. Also the collapse key (apns-collapse-id, FCM collapse_key), so one message pushed twice is one notification. Dedupe your inbox by it. |
title | Already rendered. Templates run at publish, never at send. |
body | Likewise. Markdown only when markdown is set. |
url | Where a plain tap goes: the publisher's click_url, else https://notify.xeonr.io/messages/<id>. Always absolute. |
topic | The topic's human name. |
topic_id | Its id, because every RPC takes the id — muting from a notification is otherwise a two-call detour. |
delivery | This person's ledger row id. Marking read from the notification itself needs exactly this. |
priority | 1–5. 5 gets the time-sensitive treatment where the platform has one; ≤ 2 is silent. |
tags | The publisher's tags. |
actions | [{label, url}], at most 3, always http(s). |
markdown | The body is markdown. Render it if you can. |
Web Push sends that as JSON, so actions is a real array and priority a
number.
APNs and FCM data payloads are string-keyed strings only, so priority is
decimal, tags is comma-joined, markdown is "1" when set and absent
otherwise, and actions is the JSON array as a string. One shape to parse,
rather than two.
Opening the app
Tap targets are ordinary https://notify.xeonr.io/... URLs, never a custom
scheme. The app claims these paths as universal links (iOS) and app links
(Android):
/messages/<id>
/topics/<id>
/inboxSo one URL opens the app on a phone and still works in an email, in a Discord message and in a browser. Everything else on the host — the console, the publish edge — stays in the browser, which is the point: a developer following a link to a topic's keys wants the console, not a phone screen that cannot show them.
Your tap rule should be: a notify.xeonr.io path the app claims → the native
screen; anything else → open externally.
Buttons, per platform
Not a gap, a platform difference:
- Web push takes per-notification buttons with your labels. Chrome shows two and silently drops the rest, so notify's own service worker renders two.
- iOS takes button titles from a pre-registered notification category, not from the notification, so per-message labels are impossible on the banner. The Notify app carries a fixed pair — Mark read and Mute topic — and shows a publisher's actions once the notification is opened.
- Email renders them as links, Discord as a markdown line.
Device registration
A device registers once, against the person — not against a topic — and then receives every subscription that routes to push. The token crosses the API exactly once, at registration, and is sealed at rest; nothing reads it back.
For iOS, apns_environment is mandatory on registration. A token sent to the
wrong APNs environment comes back as BadDeviceToken, which is indistinguishable
from a deleted app, and the sender would revoke a perfectly good registration.
Products can register their own APNs key, FCM account or VAPID pair, in which case their notifications arrive in their app rather than in Xeonr Notify — with no change to how they publish. A product that registers none gets push with no store work at all.
Never prompt for notification permission on page load. Ask the first time somebody switches push on, from a click: a site that asks before it has been asked for anything is how the permission gets denied forever.