This document describes the complete bidirectional push notification integration between Acrobits mobile clients and Matrix/Synapse homeserver, as implemented by the matrix2acrobits proxy. It covers both pusher registration (client → proxy → Synapse) and push gateway handling (Synapse → proxy → Acrobits PNM → device).
┌───────────────┐ ┌────────────────────┐ ┌───────────────┐
│ Acrobits App │────>│ matrix2acrobits │────>│ Synapse │
│ (Mobile) │ │ Proxy │ │ Homeserver │
└───────────────┘ └────────────────────┘ └───────────────┘
│ │ ▲
│ │ │
▼ ▼ │
┌─────────────┐ ┌─────────────┐
│ Acrobits │ │ Mobile │
│ PNM │ │ Device │
└─────────────┘ └─────────────┘
- Push Token Registration:
- Acrobits app sends push token to proxy
- Proxy saves token and registers a pusher with Synapse
- Push Notification Delivery:
- Synapse sends push notification to proxy (Push Gateway API)
- Proxy translates and forwards notification to Acrobits PNM
- Acrobits PNM delivers to mobile device
When the Acrobits mobile app starts, it reports its push token to the proxy. The proxy:
- Stores the token and app info in its local database
- Resolves the selector to a Matrix user ID
- Registers a pusher with Synapse using the Matrix Client-Server API (
/_matrix/client/v3/pushers/set)
- The pusher tells Synapse to send push notifications for this user to the proxy's push gateway endpoint
When a message arrives for a user, Synapse:
- Finds registered pushers for the user
- Sends a push notification to the proxy (
/_matrix/push/v1/notify) - The proxy:
- Looks up the pushkey in its database
- Translates the Matrix notification format to Acrobits PNM format:
- Maps
event_id→Id(deduplication) - Maps
sender/sender_display_name→UserName/UserDisplayName - Maps message
body→Message - Maps
unreadcount →Badge - Maps
room_id→ThreadId - Extracts
soundfromtweaks
- Maps
- Forwards the notification to Acrobits PNM (
https://pnm.cloudsoftphone.com/pnm2/send) - Handles response: returns rejected pushkeys to Synapse if tokens are invalid (404 from Acrobits)
- Client reports push token:
POST /api/client/push_token_report- Example:
{ "selector": "12869E0E6E553673C54F29105A0647204C416A2A:7C3A0D14", "token_msgs": "APA91bG9aqWvmnxnYBZWG9hxvtkgzTXSopfiufzmc6tP3Kb...", "app_id_msgs": "com.acrobits.softphone", "token_calls": "...", "app_id_calls": "..." }
- Proxy saves token to local SQLite DB
- Proxy resolves selector to Matrix user ID
- Proxy registers pusher with Synapse:
POST /_matrix/client/v3/pushers/set- Example:
{ "app_display_name": "com.acrobits.softphone", "app_id": "com.acrobits.softphone", "append": false, "device_display_name": "Acrobits Softphone", "kind": "http", "lang": "en", "pushkey": "APA91bG9aqWvmnxnYBZWG9hxvtkgzTXSopfiufzmc6tP3Kb...", "data": { "format": "event_id_only", "url": "https://matrix-proxy.example.com/_matrix/push/v1/notify" } } - Tells Synapse to send push notifications to the proxy's push gateway endpoint.
- Synapse sends notification to proxy:
POST /_matrix/push/v1/notify- Example:
{ "notification": { "event_id": "$event_id", "room_id": "!room:example.com", "sender": "@alice:example.com", "sender_display_name": "Alice", "content": { "msgtype": "m.text", "body": "Hello!" }, "devices": [ { "app_id": "com.acrobits.softphone", "pushkey": "APA91bG9aqWvmnxnYBZWG9hxvtkgzTXSopfiufzmc6tP3Kb...", "tweaks": {} } ] } }
- Proxy looks up push token in DB using pushkey
- Proxy translates notification to Acrobits format:
- Maps
event_id→Id - Maps
sender/sender_display_name→UserName/UserDisplayName - Maps message
body→Message - Maps
unreadcount →Badge - Maps
room_id→ThreadId - Extracts
soundfromtweaks
- Maps
- Proxy forwards to Acrobits PNM at
https://pnm.cloudsoftphone.com/pnm2/send:- Example:
{ "verb": "NotifyTextMessage", "AppId": "com.acrobits.softphone", "DeviceToken": "APA91bG9aqWvmnxnYBZWG9hxvtkgzTXSopfiufzmc6tP3Kb...", "Badge": 1, "Sound": "default", "UserName": "@alice:example.com", "Message": "Hello!", "ContentType": "text/plain", "ThreadId": "!room:example.com" }
- Example:
- Proxy handles response:
- Returns rejected pushkeys to Synapse if tokens are invalid (404 from Acrobits)
- Example response to Synapse:
{ "rejected": ["pushkey1", "pushkey2"] }
- Set push gateway URL to:
https://your-proxy-domain.com/_matrix/push/v1/notify
- Required:
export PROXY_URL="https://matrix-proxy.example.com"
- Must be publicly accessible from Synapse and use HTTPS.
- If unset, proxy will skip pusher registration but still handle push notifications.
- Clients must report tokens via
/api/client/push_token_report. - Stores selector, token/app IDs for messages/calls.
- Push token not found: Pushkey added to
rejectedlist - Acrobits PNM 404: Token is invalid, added to
rejectedlist - Other Acrobits errors: Logged, not marked as rejected
- Network errors: Logged, not rejected (homeserver will retry)
- Pusher registration errors: Logged, token still saved
- Matrix
event_idpassed as AcrobitsIdfor deduplication
- Append=false: Only one active pusher per app/device
- Format=event_id_only: Minimal data sent, privacy preserved
- User resolution: Selector resolved to Matrix user ID