Mobile & web push
Reach apps and browsers with Firebase Cloud Messaging, Apple Push, and the Web Push (VAPID) standard.
Firebase Cloud Messaging (Android + iOS)
| Field | Type | Description |
|---|---|---|
project_idreq | string | Firebase project ID. |
service_account_jsonreq | string | Service account credentials JSON (HTTP v1 API). |
Apple Push (APNs)
| Field | Type | Description |
|---|---|---|
team_idreq | string | Apple Developer team ID. |
key_idreq | string | APNs auth key ID. |
private_keyreq | string | APNs .p8 private key. |
bundle_idreq | string | App bundle identifier. |
apns_environment | string | production or sandbox. Defaults to production. |
Web Push (VAPID)
| Field | Type | Description |
|---|---|---|
vapid_public_keyreq | string | VAPID public key. |
vapid_private_keyreq | string | VAPID private key. |
vapid_subjectreq | string | Contact mailto: or URL. |
Register device tokens
Before you can push to a device, register its token against a contact with POST /device_tokens. The contact is created from the email if it doesn’t exist yet.
| Field | Type | Description |
|---|---|---|
tokenreq | string | The device/push token from FCM, APNs or the browser Push API. |
emailreq | string | Identifies the contact the device belongs to. |
platformreq | string | ios, android or web. |
device_name | string | Optional label shown in the UI. |
app_id | string | Optional app identifier. |
register-device.sh
curl https://api.messy.sh/device_tokens \
-H "Authorization: Bearer $MESSY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "email": "ada@example.com", "platform": "ios", "token": "<device-token>" }'Update a token with PATCH /device_tokens/{id} (for example to deactivate it) and remove one with DELETE /device_tokens/{id}. Then send with type set to mobile_push or web_push. FCM and APNs can run side by side in one environment.