Skip to main content

Push Notifications

a0 provides built-in push notification delivery through FCM (Android) and APNs (iOS). Your Convex backend sends notifications via a0’s API — no third-party push services needed.
Push notifications do NOT work in Expo Go or the a0 preview app. Test with a custom APK (Android) or TestFlight build (iOS).

How it works

  1. Your app collects device push tokens using expo-notifications
  2. Your Convex backend calls internal.notifications.sendNotification
  3. a0 detects the platform from the token and delivers via FCM or APNs
The convex/notifications.ts file is automatically included in your project. It’s an internal action — only your server-side Convex functions can call it, not the client.

Getting a device push token

Use getDevicePushTokenAsync() from expo-notificationsnot getExpoPushTokenAsync():

Sending notifications

Call sendNotification from your Convex backend using internal (not api):

Android Setup

Follow the Android FCM Setup guide to configure Firebase Cloud Messaging credentials:
  1. Create a Firebase project and add your Android app
  2. Download google-services.json
  3. Create a Firebase service account key (for FCM v1 delivery)
  4. Upload both in Project Settings → Build Settings → Android Credentials
  5. Create a new APK build

iOS Setup

iOS push notifications are configured per Apple Developer team:
  1. Connect your Apple Developer account via the Publish → App Store flow
  2. Set up APNs credentials (automatic or manual) from the team management dialog
  3. Create a new App Store / TestFlight build
The aps-environment entitlement is included automatically in all builds.

Handling notifications in your app

Troubleshooting