NewPlatano

Expo Notifications with EAS | Complete Guide

Beto, September 11, 2024 · 118,403 views

Learn how to configure Expo push notifications using Expo Application Services (EAS). You'll learn how to set up Firebase Cloud Messaging version 1 credentials for Android, which is now required since the legacy API no longer works. You’ll also see how to test push notifications on real Android and iOS devices.

If you want to build and test push notifications in your Expo app with the latest Firebase setup and EAS build workflows, this guide walks you through the entire process from Firebase project creation to uploading credentials and triggering builds.

What's inside

  • Introduction to Expo notifications with EAS and Firebase Cloud Messaging v1
  • Testing push notifications on real Android and iOS devices
  • Creating a Firebase project and generating service account keys
  • Uploading Firebase credentials to EAS for Android builds
  • Configuring app identifiers and package names in app.json
  • Using EAS CLI commands to initialize projects and manage credentials
  • Triggering Android builds with new keystore generation
  • Viewing and managing credentials and builds on the Expo dashboard

Introduction to Expo notifications with EAS and Firebase Cloud Messaging v1

Expo now requires Firebase Cloud Messaging (FCM) version 1 for Android push notifications, as the legacy FCM API is deprecated and no longer works. I explain how to configure your Expo app to use the new FCM version 1 credentials with EAS.

You’ll learn how to generate the necessary Firebase service account key and upload it to EAS so your Android builds can send push notifications correctly. The default Expo push notification behavior will fallback to legacy only if legacy credentials exist, but the recommended approach is to use FCM v1.

Testing push notifications on real Android and iOS devices

Testing push notifications requires real devices; simulators or emulators won’t show notifications properly. I demonstrate sending push notifications to both Android and iOS devices using Expo’s push notification tool at expo.dev/notifications.

You’ll see how to copy your device’s Expo push token and send customized notifications with title, body, subtitle (iOS), badge count, sound, and Android channel ID. This helps verify your push setup is working end-to-end.

Creating a Firebase project and generating service account keys

To use FCM v1, you must create a Firebase project in the Firebase console. I walk through creating a new project, disabling Google Analytics (optional), and generating a private service account key under the “Service accounts” tab.

This JSON key file contains credentials your app needs to authenticate with Firebase for push notifications. I stress keeping this file secure since it cannot be recovered if lost.

Uploading Firebase credentials to EAS for Android builds

Once you have the Firebase service account JSON file, you upload it to EAS using the command. This associates the credentials with your Android build profile.

I show how to specify the path to the JSON file and upload it securely. This step is essential for EAS to include the correct Firebase credentials when building your Android app.

Configuring app identifiers and package names in app.json

Your app.json must include valid Android package names and iOS bundle identifiers. I highlight fixing invalid package names (e.g., removing dashes) and adding these identifiers under the respective platform keys.

These identifiers must match what you register in Firebase and Expo to ensure push notifications are routed correctly.

Using EAS CLI commands to initialize projects and manage credentials

I demonstrate using EAS CLI commands like to verify your Expo account, to initialize your project with EAS, and to manage credentials.

You’ll see how EAS creates an eas.json file with build profiles (development, preview, production) to configure builds. This workflow integrates your push notification credentials into the build process.

Triggering Android builds with new keystore generation

To complete the setup, you trigger a new Android build with . I show how EAS prompts to generate a new Android keystore if you don’t have one.

Generating or providing a keystore is required for signing your Android app and enabling push notifications. After the build starts, you can monitor and cancel builds from the Expo dashboard.

Viewing and managing credentials and builds on the Expo dashboard

The Expo dashboard at expo.dev lets you view your project’s builds and credentials. I show checking the Android keystore and Firebase credentials under the credentials tab once builds are triggered.

This dashboard helps you confirm your push notification setup is complete and troubleshoot any issues with builds or credentials.

Resources

CourseReact Native course

Premium resourcePro Membership

Let's connect!

Had a win? Get featured on Code with Beto.Share your story