Push notifications
Native APNs (HTTP/2) for iOS, Firebase Cloud Messaging (HTTP v1) for Android & web. Configured per project. Used for "Alice is live now!", chat mentions, premiere reminders, order updates.
On this page
1. Configure your project (APNs + FCM)
Push credentials are scoped to a project, not the whole tenant. This lets you run dev/staging/prod environments with different APNs bundles or FCM projects.
APNs (iOS)
You need an Apple Developer key (.p8 file):
- Apple Developer Portal → Certificates, Identifiers & Profiles → Keys → "+"
- Enable "Apple Push Notifications service (APNs)"
- Download the .p8 file (you can only download it once)
- Note the Key ID + your Team ID + the bundle identifier of your iOS app
POST /v1/me/push/projects/<projectId>/credentials/apns
Authorization: Bearer kl_live_xxx
{
"apnsEnabled": true,
"apnsTeamId": "ABCDE12345",
"apnsKeyId": "ABC1234567",
"apnsBundleId": "com.example.your-app",
"apnsPrivateKey": "-----BEGIN PRIVATE KEY-----\nMIGTAg...\n-----END PRIVATE KEY-----\n",
"apnsProduction": false // false = sandbox APNs (TestFlight); true = production
}
→ { "apnsConfigured": true, "apnsBundleId": "com.example.your-app", ... }
FCM (Android + Web)
You need a Firebase service-account JSON:
- Firebase Console → Project settings → Service accounts
- "Generate new private key" → download the JSON
POST /v1/me/push/projects/<projectId>/credentials/fcm
{
"fcmEnabled": true,
"fcmServiceAccount": { ...the full JSON object... }
}
→ { "fcmConfigured": true, "fcmProjectId": "your-firebase-project", ... }
Status check:
GET /v1/me/push/projects/<projectId>/credentials
→ {
"apnsEnabled": true, "apnsConfigured": true, "apnsBundleId": "...", "apnsProduction": false,
"fcmEnabled": true, "fcmConfigured": true, "fcmProjectId": "..."
}
2. Register a device token
When your mobile app starts, it gets a device token from the OS. Send it to Kardolive attached to the user it represents:
POST /v1/me/push/devices
{
"userId": "user_42", // your-app's stable user id
"platform": "ios", // "ios" | "android" | "web"
"token": "<device-token-from-OS>",
"appVersion": "1.4.2",
"locale": "en-US",
"projectId": "proj_xxx" // the project this user belongs to
}
Re-call this on every app start. Kardolive deduplicates by (tenant, token) and updates lastSeenAt + active flag.
3. Automatic chat-mention pushes
No code required. When a chat message contains a mention (@user_42) or is sent
in a direct channel, Kardolive automatically looks up that user's device tokens and pushes:
title: "<channel name>"
body: "<sender>: <message body truncated to 200 chars>"
data: { kardolive: "1", channelId: "...", projectId: "..." }
Self-mentions don't push. Stale tokens (HTTP 410 from APNs, 404 from FCM) get marked inactive automatically.
4. Custom broadcasts (going-live, premiere, etc.)
For everything beyond chat — "the seller you follow is live", "your auction was won", "order
shipped" — call /notify. You decide who's an audience; Kardolive delivers.
POST /v1/me/push/notify
{
"projectId": "proj_xxx",
"userIds": ["user_1", "user_5", "user_99"], // your-app's user ids; up to 5000
"title": "Going live now",
"body": "Saturday Drop: linen collection",
"data": {
"kind": "stream.live",
"streamId": "stream_abc"
}
}
→ { "delivered": 47, "attempted": 52 }
delivered = pushes that returned 2xx from APNs/FCM. The 5 missing in the example
above had stale tokens — they got auto-deactivated. data propagates to the
device, so your mobile app can deep-link the user into the stream/order/auction screen.
5. Unregister a device
Call this on logout or "disable notifications" in your app's settings:
DELETE /v1/me/push/devices/<token>
Sets active=false on every row matching that token. Re-registering reactivates it.
Common patterns
| Pattern | Implementation |
|---|---|
| "Alice is live!" to her followers | Your-app maintains the follower graph. When stream.started fires, look up Alice's followers, call /notify with their userIds. |
| Premiere reminder 30 min before | Schedule a cron in your-app at scheduledFor - 30min. When it fires, call /notify with the same notifyUserIds. |
| Order shipped | Your-app handles the carrier webhook. Look up the buyer's userId, call /notify. |
| Auction won | Kardolive sends auction.won webhook with winnerExternalId. Your-app calls /notify back. |