Push Notifications
Register device tokens from the SDK and send targeted push campaigns to iOS and Android devices.
Amba runs the full push pipeline. Your app registers a device token through the SDK; you (or your AI agent) create campaigns scoped by segment or schedule; Amba delivers to iOS (via APNs) and Android (via FCM) with retries and per-delivery tracking.
How it works
- After a user grants permission, the app calls
client.push.registerToken(token, platform). - Admins (or MCP-driven agents) create push campaigns — title, body, data payload, optional
segment_id, optionalscheduled_at. - Sending (either immediately or at
scheduled_at) hands the campaign off to Amba. The campaign's segment is resolved, registered tokens are loaded, users are batched, and the platform-specific delivery runs. - Per-token delivery status is captured so you can see who actually got the notification.
Four campaign shapes:
| Shape | Configuration | Trigger |
|---|---|---|
| Broadcast | no segment_id | Sent to every registered token for the project |
| Targeted | segment_id: "seg_xxx" | Sent only to users in that segment |
| Scheduled | scheduled_at: "2026-01-15T09:00:00Z" | Delivered at the given UTC time (one global instant) |
| Local-time | delivery_mode: "local_time", local_date: "2026-01-15", local_time: "09:00" | Delivered at 09:00 in each recipient's local timezone (UTC if unset) |
SDK usage
Method signatures:
Register a push token
Remove a push token
Expo setup
Amba.registerPushToken() is the canonical one-call path on Expo. It requests notification permission via expo-notifications, fetches the device's native APNs / FCM token, and forwards it to Amba.push.register — no manual permission dance required:
Peer-deps on expo-notifications + expo-device — both are already in the standard Expo template; install with npx expo install expo-notifications expo-device if you started from a stripped template.
Enable the Expo config plugin in app.json:
The plugin adds the iOS push entitlement, URL schemes, associated domains, and Android intent filters for notification interactions.
Provider setup
To actually deliver pushes, Amba needs your APNs key and / or FCM service-account credentials. These are encrypted at rest under your project's integration config.
iOS (APNs)
You need:
- An APNs Auth Key (
.p8file) from Apple Developer → Keys. - The key's Key ID (10 characters, shown next to the key).
- Your Team ID (10 characters, shown in the top right of Apple Developer).
- Your app's bundle identifier (e.g.
com.example.todoapp).
Configure via MCP:
Use sandbox for development (TestFlight / Xcode builds) and production for App Store releases.
Android (FCM)
You need:
- A Firebase project linked to your app's package name.
- A service account JSON with the
Firebase Cloud Messaging APIpermission. Download from Firebase console → Project settings → Service accounts.
Configure via MCP:
Creating campaigns
Via the Admin API
Response:
The API rejects scheduled_at values that are in the past or unparseable — it returns 400 SCHEDULED_AT_IN_PAST or 400 INVALID_SCHEDULED_AT.
Trigger immediate delivery
Status flips to sending and Amba starts delivering in batches.
Send a test notification
Via MCP (agent-driven)
Routes reference
| Method | Path | Description |
|---|---|---|
POST | /client/push/tokens | Register device token |
DELETE | /client/push/tokens/:token | Remove device token |
POST | /admin/projects/:projectId/push/campaigns | Create campaign |
GET | /admin/projects/:projectId/push/campaigns | List campaigns |
GET | /admin/projects/:projectId/push/campaigns/:id | Get campaign |
POST | /admin/projects/:projectId/push/campaigns/:id/send | Trigger immediate send |
POST | /admin/projects/:projectId/push/test | Send a test push to a device token |
MCP tools
| Tool | Description |
|---|---|
amba_push_campaigns_create | Create a new campaign with optional segment targeting and scheduling |
amba_push_campaigns_send | Trigger delivery of a draft / scheduled campaign |
amba_push_send_test | Send a test push to a specific device token |
amba_integrations_configure | Configure APNs or FCM credentials |