Android (FCM)
Push notifications in GamePush Android builds are delivered via Firebase Cloud Messaging (FCM). Notifications arrive even when the game is closed, and tapping a notification opens the game and passes the notification data to it.
How it works
- You create a Firebase project and register an Android app with the package name of your build in it.
- You upload the
google-services.jsonfile from Firebase to GamePush. With it, the builder adds thecordova-plugin-firebasex-messagingplugin to the build — no changes to the game code are needed. - You add a Firebase service account to the notification settings. GamePush sends pushes with it.
Requirements
- The game is built in Hosting → Android Build Configuration (Cordova builds).
- A Google account with access to the Firebase console. The free Spark plan is enough.
- Notifications are enabled in Notifications → Settings.
Setup
1. Find the package name of the build
Open Hosting and in the Android Build Configuration block click the bell button — Push notifications (Firebase google-services.json).

The window shows the package name of the build — the id from config.xml, for example com.gamepush.game6583c39e7a08f52ed5640c68. Copy it: you need to register the app in Firebase with this name.
The package name in Firebase must match the id in config.xml exactly. If you change the id in config.xml, register a new app in Firebase and upload a new google-services.json.
2. Create a Firebase project
Open the Firebase console and create a new project or pick an existing one. Google Analytics is not needed for pushes, you can turn it off when creating the project.
One Firebase project can serve several games: add a separate Android app to it for each game.
3. Add an Android app
On the project home page (Project Overview) click Add app and choose Android.
- Paste the package name from step 1 into Android package name.
- Click Register app.
App nickname is an optional name for yourself, for example the name of the game.
On the next step click Download google-services.json and save the file.
Skip the Firebase instructions for Android Studio and the Add Firebase SDK step: click Next, then Continue to console. The GamePush builder connects Firebase to the build itself.
Open Settings → General (the gear in the left menu).

At the bottom of the page, in Your apps, select the Android app and click google-services.json. You can also check the Package name here.

4. Upload google-services.json to GamePush
Go back to Hosting → Android Build Configuration → Push notifications (Firebase), drop the file into the window or select it, and click Save.
After saving, the window shows the Firebase project and the Android apps from the file.
If the file has no app with the package name of the build, the window shows a warning and the build will not start. Add the app in Firebase (step 3) and upload the file again.
The Remove button removes the file: the next builds will be without push notifications.
5. Add a Firebase service account
GamePush needs a service account to send pushes via FCM.
- In Firebase open Settings → General and go to the Cloud Messaging tab. Make sure Firebase Cloud Messaging API (V1) is Enabled. In new projects the API is enabled by default.

- Go to the Service accounts tab and click Generate new private key, then Generate key. Firebase downloads a JSON file with the key.

- In GamePush open Notifications → Settings, paste the whole content of the file into Service account JSON in the Firebase Cloud Messaging (Android) block and click Save.

The service account key gives access to your Firebase project. Do not publish it or share it with third parties. GamePush stores the key write-only: after saving, the panel shows only the Firebase project ID. If the key leaks, delete it in Google Cloud (Manage service account permissions) and create a new one.
If one Firebase project is used for several games, you can use the same key in all of them.
6. Rebuild the app
Start a new build in Hosting → Android Builds Management. The cordova-plugin-firebasex-messaging plugin is added only to builds started after google-services.json is uploaded — APK and AAB files built earlier will not receive pushes.
7. Request permission in the game
Call gp.notifications.requestPermission() at the right moment. On Android 13+ the player sees the POST_NOTIFICATIONS system dialog; on older versions the permission is granted automatically. After that the player's device is registered in GamePush as an FCM channel.
if (gp.notifications.isAvailable && gp.notifications.canRequest) {
myGame.showSoftAsk(() => gp.notifications.requestPermission());
}
Testing
- Install the new build on a phone and sign in to the game as a test player.
- Call
requestPermission()and allow notifications. - Send a test push from a template (Notifications → Templates → Send test) or schedule a notification with
gp.notifications.schedule(). - Minimize or close the game and wait for the notification. Tapping it opens the game and passes the payload to it.
Checklist
- The package name of the app in Firebase matches the
idin config.xml. google-services.jsonis uploaded in Hosting → Android Build Configuration, with no package name warning.- The service account is added in Notifications → Settings → FCM, and the panel shows the Firebase project ID.
- The service account and
google-services.jsoncome from the same Firebase project. - The build was started after
google-services.jsonwas uploaded. - The player allowed notifications: notifications for the game are on in Android settings.
- Notifications are enabled in the project settings, and the player is not in quiet hours and has not hit the daily push limit.
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
GamePush Community Telegram: @gs_community.
For your suggestions e-mail: official@gamepush.com
We Wish you Success!