Android Firebase credentials
Learn how to generate and configure Firebase Cloud Messaging (FCM) Service Account credentials for OneSignal to send Android push notifications to apps on the Google Play Store.
To send push notifications to Android devices through the Google Play Store, OneSignal requires Firebase Cloud Messaging (FCM) credentials. This guide walks you through generating the required Service Account JSON file and uploading it to your OneSignal app settings.
For technical background, see Google’s Service Account documentation.
This guide is for developers integrating OneSignal with an Android mobile app distributed via the Google Play Store.
- This guide should not be used for Web Push. See Web push setup.
- For Huawei apps distributed via the Huawei App Gallery, see Huawei: Authorizing OneSignal.
Requirements
- An Android app distributed via the Google Play Store
- A Firebase account (free)
- A OneSignal account
Setup
1. Create or open your Firebase Project
Go to the Firebase console.
- If you don’t have a project yet, click Add project and complete the setup.
- If you already have a project, select it.
Page of Projects within Firebase
2. Enable Firebase Cloud Messaging API v1
Go to Project Settings
In Firebase, click the gear icon next to Project Overview > Project settings.
Firebase gear icon submenu, showing Project Settings
Go to Cloud Messaging
Go to the Cloud Messaging tab.
If Firebase Cloud Messaging API (V1) is disabled, click the 3-dot menu > Open in Cloud Console.
Firebase Cloud Messaging API (V1) is disabled in this image. Ensure it is enabled for your project.
In the Google Cloud Console, click Enable. Wait a few minutes for the change to reflect in Firebase.
Enable Firebase Cloud Messaging API v1.
3. Generate a Service Account JSON file
Return to Project Settings > Service Accounts
At the bottom, click Generate new private key.
Service Accounts section within Firebase
Confirm and generate key
Confirm by clicking Generate key in the popup.
🔒 This file contains sensitive credentials. Do not share it or check it into version control.
Save the file
Save the .json
file in a secure location. You will need it shortly.
Required Service Account permissions:
cloudmessaging.messages.create
firebase.projects.get
These are included by default. If you’re using a custom Service Account, ensure it has:
roles/firebasemessaging.admin
roles/firebase.viewer
4. Upload your credentials to OneSignal
Go to Android platform settings
In your OneSignal dashboard, go to: Settings > Push & In-App > Push Platforms > Google Android (FCM).
Click Activate.
Platforms screen within OneSignal app settings
Upload your credentials
Upload the .json
file under Service Account JSON by clicking Choose file.
FCM configuration screen
If prompted, select Firebase Cloud Messaging API (V1) from the dropdown.
To verify you’re using the correct Firebase project, match the Sender ID in Firebase (Cloud Messaging > Sender ID
) with the one shown in your OneSignal settings.
Save and continue
Choose your SDK
Select the SDK you are using and click Save & Continue.
SDK selection screen
Add the OneSignal App ID to your code
Continue following the Mobile SDK setup and add this OneSignal App ID to your code.
Android configuration installation and testing screen
You’ve successfully connected your OneSignal app to Firebase Cloud Messaging (V1).
Next, complete Mobile SDK setup or go to Mobile push setup for platform-specific instructions.
FAQ
Error: “This configuration is for a different Firebase Project…”
This error occurs when the uploaded JSON file belongs to a different Firebase project (i.e., different Sender ID).
Solution: Use the original Firebase project’s JSON file. If unavailable, contact support@onesignal.com
with your App ID. Switching projects resets push tokens—your users must reopen the app to get push again.
Can I change my Sender ID?
No. The Sender ID is locked once your app surpasses 100 Android users to prevent accidental invalidation of push tokens.
If necessary, contact support@onesignal.com
with your App ID for assistance.
Do I need to update my code when switching to FCM V1?
No app or SDK changes are required—this is a dashboard-only update.
What is the deadline for switching to FCM v1?
Google began deprecating legacy FCM APIs in July 2024. Migration is strongly recommended. See Google’s announcement.
Why don’t I see a Sender ID in OneSignal?
If your Firebase server key looks like AIz...
, you’re likely using an outdated Google Cloud Messaging (GCM) setup. Create a new Firebase project and upload a Service Account JSON file.
How can I check which apps are still using the Legacy API?
Use the View apps API and check for:
"gcm_key"
→ using Legacy, needs update"fcm_v1_service_account_json"
→ using V1 ✅- Neither → app does not use Android push