Firebase Credentials
Generate the Firebase Service Account JSON that lets notifySphere send push notifications through FCM.
Overview#
notifySphere sends push through Firebase Cloud Messaging (FCM). It needs one Firebase Service Account JSON file from your Firebase project, and that one file covers both Android and iOS. This guide shows how to get it.
What notifySphere does with this key#
notifySphere uses the key for one thing: sending push notifications to your app through Firebase Cloud Messaging. It doesn't read your Authentication users, Firestore, Realtime Database, Storage or any other Firebase data.
The default Firebase Admin SDK key (steps below) has broad access to your project. If you prefer, create a key that can only send push instead. Both work the same in notifySphere.
Optional: a key that can only send push#
Open Service Accounts in Google Cloud
Go to Google Cloud Console → IAM & Admin → Service Accounts and pick the same project as your Firebase app.
Create a service account
Click Create service account and give it a name such as
notifysphere-push.Give it only the messaging role
Under Grant this service account access, choose the role Firebase Cloud Messaging API Admin and nothing else, then click Done.
Create a JSON key
Open the new service account, go to the Keys tab, then Add key → Create new key → JSON. Upload that file to notifySphere instead of the Admin SDK key, and send a test notification to check it works.
Revoke a key at any time#
In Google Cloud Console → IAM & Admin → Service Accounts, open the service account, go to Keys and delete the key. It stops working straight away, everywhere it was used, including notifySphere. To switch keys without a gap, create and upload the new key first, then delete the old one.
Before you start: add your apps to Firebase#
In your Firebase project, register each platform your app runs on:
- Android: add an Android app with your package name, then download
google-services.jsonintoandroid/app/. - iOS: add an Apple app with your bundle ID, then add
GoogleService-Info.plistto your Xcode project. Also upload your APNs authentication key (.p8) under Project settings → Cloud Messaging, or iOS devices won't receive anything.
These two files go in your app. The Service Account JSON below is a different file, and it goes to notifySphere.
Generate and upload the key#
Access Firebase Console
Go to the Firebase Console and select your project, or create a new one if you haven't already.
Open Project settings
Click the settings (gear) icon next to "Project Overview" in the left sidebar and select Project settings.
Open the Service accounts tab
In Project settings, click the Service accounts tab. The Firebase Admin SDK section is selected.
Generate a new private key
Under Firebase Admin SDK, click Generate new private key. A dialog warns you to keep the key confidential; click Generate key to download the JSON file.
Verify the JSON file contents
Your downloaded JSON file should contain the following fields:
Field Type Description typestringShould be service_accountproject_idstringYour Firebase project ID private_key_idstringUnique identifier for the private key private_keystringThe actual private key (begins with -----BEGIN PRIVATE KEY-----)client_emailstringService account email address client_idstringClient identifier auth_uristringAuthentication URI token_uristringToken URI auth_provider_x509_cert_urlstringCertificate URL client_x509_cert_urlstringClient certificate URL Upload to notifySphere
Once you have your Service Account JSON file:
- In the dashboard, open Setting → Platform → Android (FCM) Settings and go to the upload step (see Push Setup).
- Click the Service Account JSON file upload field and select your file.
- The Firebase Project ID is extracted automatically and displayed.
- Click Save & Continue to proceed.
Troubleshooting#
Invalid JSON file error#
Make sure you're uploading the correct JSON file. The file should be named something like your-project-name-firebase-adminsdk-xxxxx.json.
Missing required fields#
If you receive an error about missing fields, try generating a new service account key from the Firebase Console.
Additional resources#
Stuck or something unclear? Contact us and we'll help.