Connect Firebase and Send a Test
Connect one Firebase project for iOS and Android, prepare the app files, and send a test notification from AlgorithmX.
AlgorithmX sends mobile push notifications through Firebase Cloud Messaging (FCM) on both iOS and Android. Your app supplies an FCM registration token, and AlgorithmX uses your Firebase service account to send to it.
For iOS, Firebase delivers through Apple's APNs service. Configure the Apple credentials in Firebase; the AlgorithmX dashboard accepts a Firebase service-account JSON.
1. Register your apps in Firebase
Create or open your project in the Firebase console. Add each Android application ID and each iOS bundle ID as an app in that project. Keep the identifiers of your existing apps.
A Flutter or React Native app still has separate Android and iOS registrations. Download the matching configuration file for each platform; one mobile configuration file cannot cover both.
| File | Where it belongs | Purpose |
|---|---|---|
google-services.json | Your Android app module | Connects that Android app to Firebase. |
GoogleService-Info.plist | Your iOS app target | Connects that iOS bundle ID to Firebase. |
| Service-account JSON | AlgorithmX dashboard | Authorizes the server to send FCM messages for the project. Never bundle this private key in your app. |
Apple APNs authentication key (.p8), Key ID, and Team ID | Firebase project settings, Cloud Messaging | Lets Firebase deliver to your iOS app through Apple. |
One service account covers the iOS and Android apps in its Firebase project. You do not upload separate iOS and Android service accounts to AlgorithmX. The current dashboard connects one project at a time, so the apps you want to reach through that connection must belong to that project.
Continue with the app code in the Android, iOS, Flutter, or React Native guide.
2. Configure Apple delivery for iOS
- In Firebase, open Project settings → Cloud Messaging → Apple app configuration.
- Select the iOS app with the matching bundle ID.
- Under APNs Authentication Key, upload the Apple
.p8key and enter its Key ID and your Apple Team ID. - Configure the development or production entry for the build you will test. Direct development installs use the development environment; TestFlight and App Store builds use production. Check the signed app's
aps-environmententitlement when unsure. - Repeat for your other iOS app registrations. Reuse a key only where its team, environment, and topic permissions cover those apps.
Enable Push Notifications on the signed app target. Enable Background Modes → Remote notifications when using background push processing. Keep your app's own notification permission flow.
The Firebase configuration file and an FCM token do not prove that Apple delivery is ready. Check these settings before the first iPhone send. See Firebase's Apple setup.
3. Connect the project in AlgorithmX
In Firebase, open Project settings → Service accounts → Generate new private key. Download the service-account JSON for the project containing your mobile apps. The service account needs permission to send FCM messages for that project; see Firebase's server setup.
In AlgorithmX:
- Open Settings → In-App Integration.
- Click Upload service-account JSON.
- Choose the file and click Connect Firebase.
- Confirm that the connection shows Configured.
The uploader accepts one non-empty JSON file up to 64 KB. A valid file includes type: "service_account", project_id, client_email, and private_key. An Android google-services.json, an iOS plist, an Apple .p8 key, or a legacy FCM server-key string is not the required file.
To change the connected credentials later, click Update, select the new file, and click Update in the dialog. The change applies to both platforms. You need an Editor role or higher to upload credentials or send a test.
4. Register the app's FCM token
After initializing AlgorithmX, pass the current FCM registration token to registerDeviceToken. Send the current value on app startup and send refreshed values too. Each app installation has its own token; it is not a permanent customer ID. Different apps on the same phone have different tokens.
Use the FCM token on iOS as well as Android. The native APNs token is used by Firebase's iOS integration; do not pass its hexadecimal value to AlgorithmX. An Expo Push Token is also not an FCM token.
Your app remains responsible for configuring Firebase and obtaining the token. The core AlgorithmX SDK does not install or configure Firebase. The optional React Native Firebase adapter in SDK 1.1.1 registers current and refreshed FCM tokens on both platforms. Follow your platform guide to preserve existing notification handlers and avoid displaying the same message twice.
An app that already sends directly through APNs can keep that sending system. Add Firebase to the app for AlgorithmX, map its APNs token to Firebase, and share the resulting FCM token with AlgorithmX. Preserve the callbacks used by the existing provider.
5. Send a test notification
- Launch the app on a real phone and allow visible notifications.
- Copy its current FCM registration token using your app's Firebase integration. Use the token from the app and environment you are testing.
- Put the app in the background for the first check.
- In Settings → In-App Integration, expand Send a test notification with Open test.
- Paste the FCM registration token, enter a Title and Message, and click Send test.
- Check the phone for the notification. Repeat with the other platform and with the app open, using your app's foreground presentation handling.
The form sends to one token immediately. It does not require an iOS/Android selector. Firebase accepted the test means Firebase accepted the send request; verify receipt on the phone separately. A plain test notification checks the sending connection. Test campaign actions, images, buttons, and interaction reporting with an AlgorithmX campaign afterward.
Troubleshooting
| Problem | What to check |
|---|---|
| File cannot be connected | Download the service-account JSON from Service accounts. Check its required fields, file size, and your dashboard role. |
| Sender or project mismatch | The token's app and the uploaded service account must use the connected Firebase project. |
| Token is no longer registered | Relaunch the app, obtain its current FCM token, and register it again. A reinstall can change it. |
| Firebase accepts the test but the iPhone receives nothing | Check the selected iOS app in Firebase, APNs key/Key ID/Team ID, build environment, signing capability, and notification permission. |
| Android receives nothing | Check the app's Firebase configuration, notification permission, channel settings, and message handler. |
| Background delivery works but foreground delivery does not show a banner | Check the app's foreground presentation handling. The dashboard test is a plain notification and is not an AlgorithmX campaign payload. |
| Existing notifications appear twice or stop working | Keep one message-handling route per platform and preserve the callbacks belonging to other providers. |
For customer identity, events, and API-based in-app campaigns, continue with the integration overview.
