Skip to content

Push Notifications

Push notifications are half the reason many developers want to build a mobile app in the first place. Mosayic strongly encourages getting push notifications for both iOS and Android set up properly very early on – ideally before building your first feature or screen.

Expo and EAS handle push notification installation and sending, and the process is very streamlined with these tools – which is why Mosayic advocates for them.

Under the hood, two services power push notifications:

  • Firebase Cloud Messaging (FCM) – for Android
  • Apple Push Notification Service (APNs) – for iOS

The Expo Push Service acts as a proxy for both FCM and APNs. This is why certain credentials need to be set up in Expo, and why Mosayic had you create a Firebase account in the early setup stages.

In the Supabase database, the users table in the public schema has a field called fcm_token. This stores the Expo Push Token generated by your mobile app.

The Mosayic React Native template has all of this configured already. However, it’s absolutely worth checking – both locally and in the cloud – that your Supabase dashboard shows tokens being saved correctly in the Users table. If tokens aren’t being stored, push notifications definitely won’t work.

To test push notifications, you’ll need either:

  • A development build running in development mode
  • The app deployed to TestFlight (iOS) or built as an APK (Android)
  1. Your mobile app (using Expo tooling) generates an Expo Push Token
  2. This token gets saved to the fcm_token column in Supabase (the Mosayic template handles this)
  3. You can take this token and run a manual curl command to test whether notifications are working

For testing, you can also use the Expo push notifications tool to quickly send a test notification to your device.

How you trigger notifications is up to you. Options include:

  • Supabase hooks/triggers – when a row is added to a table, trigger a notification automatically
  • Python API – centralize notification logic in your backend (recommended)
  • Supabase Edge Functions – an alternative, though centralizing in the API is preferable

For more details, see the Expo push notifications documentation.