संचार शैली
नोटिफ़िकेशन को iOS Communication Notification styling के साथ, किनारे पर एक गोल avatar के साथ iMessage की तरह, या Android पर उसी आइकन वाली बातचीत के रूप में रेंडर करने के लिए icon_url सेट करें। Notification Center में समूहीकरण के लिए thread_id के साथ संयोजित करें।


On Android, a notification with a source posts as a conversation instead: a message from a person named after the source, with the service's icon as the avatar, listed under Conversations in the shade. Message-Style Notifications in the app's settings turns it off, and audio attachments keep the standard layout.
Source identity
| Field | Type | Description |
|---|---|---|
source | string | Stable internal id — e.g. sonarr, github-actions, home-assistant. Used for filtering and analytics. |
source_display_name | string | The pretty version users see — e.g. Sonarr, GitHub Actions.
Shown on the first line of iPhone and iPad banners
(where each field shows) and used to
group notifications under that source in iOS settings and the inbox. |
icon_url | string | http or https avatar (max 2048 chars). Recommended ≤256×256 and ≤100 KB; the iOS
extension rejects responses larger than 512 KB to protect its 24 MB memory
budget. Used as the round avatar of the Communication Notification style, which iOS applies to
every notification with a source (except audio attachments); without it the
source's built-in icon is used when PushWard has one. |
Example: Home Assistant doorbell
curl -X POST https://api.pushward.app/notifications \
-H "Authorization: Bearer hlk_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Front Door",
"subtitle": "Doorbell pressed · 13:45",
"body": "Someone is at the front door",
"level": "time-sensitive",
"source": "home-assistant",
"source_display_name": "Home Assistant",
"thread_id": "ha-doorbell",
"icon_url": "https://www.home-assistant.io/images/favicon-192x192.png",
"push": true
}'Threading with thread_id
When several notifications belong to the same "conversation," give them all the same thread_id. iOS stacks them as one expandable group in Notification Center — the
user sees a single row that opens to reveal the full list. They add up; nothing is
overwritten.
Good real-world threads:
- Every download for one show:
thread_id: "sonarr-the-bear" - Every message in one chat:
thread_id: "chat-42" - Every alert from one host:
thread_id: "alerts-prod-db-01"
# First episode
curl -X POST https://api.pushward.app/notifications \
-H "Authorization: Bearer hlk_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Sonarr",
"body": "The Bear S03E01 downloaded",
"thread_id": "sonarr-the-bear",
"source": "sonarr",
"source_display_name": "Sonarr",
"push": true
}'
# Second episode — appears stacked under the first
curl -X POST https://api.pushward.app/notifications \
-H "Authorization: Bearer hlk_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Sonarr",
"body": "The Bear S03E02 downloaded",
"thread_id": "sonarr-the-bear",
"source": "sonarr",
"source_display_name": "Sonarr",
"push": true
}'Replacement with collapse_id
When you only care about the latest value of something, send each update with the same collapse_id. APNs replaces the previous notification on-device — the user always
sees one row, and it keeps changing.
Good real-world collapses:
- CI build progress:
collapse_id: "build-482"with body cycling through "running 12%" → "running 84%" → "passed". - Live score updates:
collapse_id: "match-arsenal-chelsea". - Battery / charge percent on a 3D print:
collapse_id: "printer-x1c".
Keep collapse_id to 64 characters. PushWard stores it with the notification and returns it in
the response.
When the last update no longer applies, take it back: POST /notifications/retract with the same collapse_id removes it from every device and marks it read in the app (PushWard 1.1.0 or later
on Android, 1.20 or later on iPhone, iPad and Mac).
# Build kicks off
curl -X POST https://api.pushward.app/notifications \
-H "Authorization: Bearer hlk_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Build #482",
"body": "Status: running (12%)",
"collapse_id": "build-482",
"source": "github-actions",
"source_display_name": "GitHub Actions",
"push": true
}'
# Final status — overwrites the previous notification on-device
curl -X POST https://api.pushward.app/notifications \
-H "Authorization: Bearer hlk_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Build #482",
"body": "Status: passed (100%)",
"collapse_id": "build-482",
"source": "github-actions",
"source_display_name": "GitHub Actions",
"push": true
}'Combine the two
Use thread_id and collapse_id together to get the best of both: every
build groups under one stack in Notification Center, while each individual build only ever
shows its latest status.
{
"title": "Build #482",
"body": "Status: passed (100%)",
"thread_id": "ci-builds",
"collapse_id": "build-482",
"source": "github-actions",
"source_display_name": "GitHub Actions",
"push": true
}