Overview
Push notifications help you reach users when they are away from the app. They are most effective when they are timely, relevant, and respectful of user preferences. In Launch, notifications are sent directly through APNs on iOS and FCM on Android to give you full control over payloads, delivery, and routing.Prerequisites
- Apple Developer account (APNs)
- Firebase project (FCM)
- Development build for native entitlements
- Backend env vars set for APNs/FCM (copy from
apps/api/example.env)
iOS (APNs)
Configure APNs tokens and credentials
Android (FCM)
Configure Firebase Cloud Messaging
API
Create tokens and send notifications via curl
Guidance
Scheduling, queues, and best practices
How It Works
- The app requests permissions and registers a native device token.
- The token is stored per user in
device_tokenson the backend. - Your API sends a notification through APNs (iOS) or FCM (Android).
- The device receives and displays the notification.
API Flow (iOS + Android)
When a user opts in on the onboarding screen, the app registers a native device token and stores it in the backend. Your API then targets those tokens when sending a push. APNs uses your bundle ID as the topic, and FCM uses your Firebase project to route the message to the correct app. Key pieces in this repo:apps/mobile/app/onboarding/push-notifications.tsxapps/mobile/lib/notifications.tsapps/api/src/lib/push/apns.tsapps/api/src/lib/push/fcm.tsapps/api/src/routes/api/push.tsapps/api/src/routers/push.ts
Steps
- Configure credentials:
- Rebuild the app (push entitlements require a native build).
- Use the onboarding screen to register a device token.
- Send a test push from your API: API Setup
Test Checklist
- iOS device receives a test push
- Android device receives a test push
- Token is stored on the backend for the signed-in user
Troubleshooting
Start with platform setup guides, then see Troubleshooting.Remove / Disable
If you are not shipping push, skip the onboarding step and remove token registration inapps/mobile/lib/notifications.ts. For production removal
guidance, see Removing Features.
Best Practices
- Ask for permission only when there is clear value.
- Keep payloads short and actionable.
- Avoid excessive sends; let users control frequency.
- Use targeting for relevance instead of broadcasting by default.
- For scheduling and queueing strategies, see Guidance.