I'll help you implement push notifications in your Expo app using Firebase Cloud Messaging (FCM). Since you already have a Node.js/Express backend, we'll integrate FCM with your existing backend.
Let's create a complete solution:
google-services.json
file for Android and place it in the root of your Expo projectGoogleService-Info.plist
file and follow Expo's instructions for iOS configurationnpx expo install expo-notifications expo-device @react-native-async-storage/async-storage
app.config.js
as shown in the code project aboveprojectId
in the config with your actual Expo project IDnpm install express firebase-admin cors body-parser
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=your-client-email
FIREBASE_PRIVATE_KEY=your-private-key
FIREBASE_SERVER_KEY=your-server-key
You can get these credentials from your Firebase project settings > Service accounts > Generate new private key.
cd server
npm run dev
npx expo start --dev-client
This implementation provides a solid foundation for push notifications in your Expo app using Firebase and your existing Express backend.
Please make sure to add the following environment variables to your project: