Push notifications
Register a platform-native token, subscribe to topics, receive sends from the push campaign API.
The client SDK has two responsibilities for push:
- Register the platform-native push token (APNs on iOS, FCM on Android, web push on browsers) so the server knows where to deliver.
- Subscribe the user to named topics — message broadcasts ("breaking_news", "weekly_digest") that fan out to every subscribed device.
Actual sends are server-side via the push campaign API or scheduled fan-outs.
Quick start
Operations
register(token, platform, bundleId?)
Records the device's push token against the signed-in user. Call this:
- Once after sign-in, when you first obtain a token.
- Again whenever the platform issues a new token (rotation, app re-install).
platform is one of 'apns' (iOS APNs), 'fcm' (Android Firebase Cloud Messaging), or 'web' (web push). bundleId is required for 'apns' and 'fcm' so the server knows which app the token belongs to.
The call is idempotent — re-registering the same token for the same user is a no-op.
subscribe(topic) / unsubscribe(topic)
Opt the user into a named topic. Topic names match the same identifier shape as collection names (^[a-z][a-z0-9_]*$, up to 64 characters).
Topics are a server-side fan-out target: a single send to topic breaking_news reaches every device subscribed to it for the signed-in user, across iOS / Android / web.
Patterns
Re-register on app launch
Push tokens rotate; the platform issues fresh ones periodically. Re-register on every cold start to keep server-side delivery routing accurate:
Topic opt-in flow
Surface topic subscription as user preference toggles. Persist the toggle state in a collection so the user's choice survives across devices:
Permission UX
Always request the OS push permission separately — register only after the user has explicitly granted permission. The SDK's register() will accept a token without permission, but no notification will deliver.
Limits
- Topic count per user: up to 100 simultaneous topic subscriptions per user.
- Topic name: lowercase identifier, up to 64 characters.
- Token freshness: tokens are not validated by the SDK at register time. If a token has been invalidated by the platform (e.g. user uninstalled and reinstalled), pushes to it will silently fail server-side until you re-register with a fresh token.
- Platform requirements: APNs requires the Push Notifications capability in Xcode. FCM requires
google-services.jsonand the Google Services Gradle plugin. Web push requires a service worker and a VAPID key pair. - No client-side send: client SDKs cannot send pushes; that's the push campaign API or scheduled fan-outs.
Reference
- Client API — push — register / subscribe endpoint reference.
- Admin API — push campaigns — server-side send.
- Auth feature — prerequisite.
- Per-platform quickstarts: Web, React Native, Expo, iOS, Android, Flutter, Unity.