Firebase Configuration
The mobile app uses Firebase Cloud Messaging (FCM) for push notifications. Connect your own Firebase project before building the app.
On this page
1. Create a Firebase project
Open the Firebase Console
Go to console.firebase.google.com and sign in with a Google account.
Create the project
Click Create a project, enter a name, and continue through the wizard.
Wait for it to finish
When the project is ready, click Continue.
2. Add the Android app
Register the app
In Project settings, click Add app → Android and enter your Android package name, for example
com.yourcompany.salex.Download the config file
Download
google-services.json.-
Copy it into the project
Place the file at:
android/app/google-services.json
3. Add the iOS app
Register the app
In Project settings, click Add app → iOS and enter your iOS bundle identifier, for example
com.yourcompany.salex.Download the config file
Download
GoogleService-Info.plist.-
Copy it into the project
Place the file at:
ios/Runner/GoogleService-Info.plistFor iOS, it is best to add the file through Xcode (File → Add Files to "Runner") so it is included in the build.
4. Configure with FlutterFire CLI (recommended)
FlutterFire CLI generates the Firebase settings file for every platform automatically.
dart pub global activate flutterfire_cli
firebase login
flutterfire configureSelect your Firebase project when asked and finish the prompts. The command generates:
lib/firebase_options.dartfirebase login needs the Firebase CLI installed (npm install -g firebase-tools).5. Verify initialization
Firebase must be initialized before the app starts. In lib/main.dart you should see:
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);6. Check Cloud Messaging
Open Project settings
In the Firebase Console, click the gear icon, then Project settings.
Open the Cloud Messaging tab
Confirm that Firebase Cloud Messaging is enabled.
Push notifications are used for order updates, promotions and general announcements. On Android 13 and newer the user must tap Allow when the app asks for notification permission.
7. Test a notification
Install on a real device
Emulators are unreliable for push notifications, so use a physical phone.
Log in to the app
Allow notifications when prompted.
Send a test message
In the Firebase Console go to Messaging, create a test notification and send it to the device.
✓ Success looks like: the test notification appears on your phone.
Rebuild after adding the files:
flutter clean
flutter pub get
flutter run