Push Notifications
Register device tokens from the SDK and send targeted push campaigns via APNs and FCM.
Amba ships a full push pipeline: the client SDK registers device tokens, you (or your AI agent) create campaigns scoped by segment or schedule, and Amba fans out to APNs (iOS) and FCM (Android) with retries and 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, tokens are fetched frompush_tokens, users are batched, and the platform-specific delivery runs. - Delivery status lands in
push_deliveriesper token so you can see who actually got the notification.
Three 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 |
SDK usage
Method signatures:
Register a push token
Remove a push token
Expo setup
Amba.init() automatically calls registerForPushNotificationsAsync() and, if the user grants permission, forwards the token to the Amba server. To defer this (e.g. ask for permission later after onboarding):
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 stored encrypted in project_integrations.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_create_push_campaign | Create a new campaign with optional segment targeting and scheduling |
amba_send_push_campaign | Trigger delivery of a draft / scheduled campaign |
amba_send_test_push | Send a test push to a specific device token |
amba_configure_integration | Configure APNs or FCM credentials |
Database tables
| Table | Purpose |
|---|---|
push_tokens | Device tokens with platform (ios / android) + the owning app_user_id |
push_campaigns | Campaign definitions: title, body, data, segment, scheduled_at, status |
push_deliveries | Per-token delivery log with status + timestamps |