4.5 Firebase Configuration
Last updated
Last updated
First, you need to go to Firebase consoles https://firebase.google.com/ as shown in the image below.
Thereafter, click on ‘Add Project’ to create a new project.
Enter the name of your project and click on continue.
In this step, if you have enabled Google Analytics, then select an account for Google Analytics by clicking on ‘Continue’ and following that, click on the ‘Create Project’ button. If Google Analytics is disabled, then directly click on ‘Create Project’. It is not necessary to enable Google Analytics for our product.
After creating the project, click on ‘Project Settings’ as shown in the image below.
Click on ‘</>’ ‘Web app create’ button as shown in the image below.
Enter the name of your Web App as shown in the image below and click on the ‘Register app’ button.
Now, you need to Get Firebase credentials. Add these credentials in the form field as shown in the example below. APIKEY = "apiKey_get_from_firebaseConfig"
AUTODOMAIN = "authdonain_get_from_firebaseConfig"
PROJECTID = "projectId_get_from_firebaseConfig"
STORAGEBUCKET ="storageBucket_get_from_firebaseConfig"
MESSAGINGSENDERID ="messagingSenderId_get_from_firebaseConfig"
APPID = "appId_get_from_firebaseConfig"
MEASUREMENTID = 'add_if_get_from_firebaseConfig'
otherwise_add=""(empty string)
Now, click on the ‘Continue to Console’ button.
Thereafter, click on service accounts as shown in the image below.
Click on the ‘Generate New Private Key’ button. It downloads one JSON file. Now copy that JSON file and paste it into firebase-adminsdk.json file which is in the root folder of your code.
In Project Settings, go to the ‘Cloud Messaging’ tab. Now, click on the 3 dots in the ‘Cloud Messaging API’ section and click on the ‘Manage API in Google Cloud Console’ option.
Enable ‘Cloud Messaging’ as shown in the image below.
Thereafter, search for the Firebase Cloud Messaging Data API
, and enable it.