This guide shows you how to set up push notifications in your app. The boilerplate includes all the necessary code structure, but platform-specific setup is required, particularly for Android devices. Important Note:
  • Android push notifications are disabled by default until you complete the setup process in this guide.
  • iOS push notifications are already enabled if you selected “yes” to enabling push notifications during your first development build.

Step 1: Service Setup

Before implementing push notifications in your app, you need to set up the necessary services for each platform:
Android push notifications are disabled by default in the boilerplate. Follow this guide to enable them for your app.
Documentation references:
1

Create a Firebase Project

  1. Go to the Firebase Console
  2. Click “Add project” (or use an existing project for your app)
  3. Follow the prompts to create and configure your project
2

Generate Service Account Key

  1. In the Firebase console, open Project settings > Service accounts
  2. Click “Generate New Private Key”, then confirm by clicking “Generate Key”
  3. Securely store the downloaded JSON file containing the private key
3

Upload Service Account Key to EAS

Using EAS Dashboard
  1. Go to your Expo project dashboard
  2. Pick your account and project
  3. Scroll down to Credentials under Project settings in the menu on the left
  4. Under Android, find your Android Application Identifier - your package name from app.json
  5. Click on it
  6. Under Service Credentials > FCM V1 service account key, click Add a service account key
  7. Under Upload new key, upload your JSON credential file and click Save
Note: Copy your SHA-1 fingerprint from the Android upload keystore table
4

Add Android App to Firebase & Download Configuration File

  1. In the Firebase Console, go to your project and click Add app and select Android
    • Enter your Android package name (found in your app.json)
    • For the App nickname, you can use your app name
    • Paste your SHA-1 fingerprint from the Android upload keystore table from the last step
    • Register the app and download the google-services.json file
  2. Save the google-services.json file
    • Put it in your project’s main folder (where your package.json or app.json files are)
  3. Just skip the rest of the flow in Firebase
    • Skip Add Firebase SDK and Next steps
Note: This is a sensitive file that should not be tracked by git. Make sure it is added to your .gitignore file, but not in the .easignore file.

Step 2: Implementation

Follow the implementation instructions in the integrations/push/README.md file included in your boilerplate codebase. This file contains all necessary steps for integrating push notifications in your application, including:
  • Code configuration
  • Integration of the google-services.json file
  • Required app.json settings
  • Build instructions

Step 3: Testing Notifications

Local Testing

The boilerplate includes a built-in notifications demo that makes testing easy:
  1. Open your development build
  2. Navigate to the Account tab
  3. Select Notifications settings
  4. Tap on Test Push Notifications
  5. Follow the on-screen instructions to send and receive test notifications

External Testing with Expo

For testing push notifications from an external source without backend setup:
  1. Get your Expo push token from the app’s test notification screen
  2. Visit expo.dev/notifications
  3. Enter your token and compose a test message
  4. Send and verify delivery on your device

Step 4: Backend Integration

1

Set Up Supabase Database

Create a device_tokens table with:
  • id, user_id, token, platform, created_at, updated_at
  • Set appropriate RLS policies
2

Register Tokens

Modify lib/notifications/useNotification.ts to send the Expo push token to Supabase when:
  • A user logs in
  • The token is refreshed
3

Create Notification Service

Build a backend service using:
  • Supabase Edge Functions or a separate server
  • Expo Server SDK for sending notifications
4

Token Management

Implement logic to:
  • Update tokens on device changes
  • Remove invalid tokens based on receipts

Step 5: Backend Testing

1

Create Test Endpoint

Build a secure function to:
  • Query user’s tokens from Supabase
  • Send test notifications
2

Monitor Delivery

Track notification statuses and handle failures

Best Practices