4.5 Firebase Configuration

4.5.1 Create Firebase Project

  1. First, you need to go to Firebase consoles https://firebase.google.com/ as shown in the image below.

  1. Thereafter, click on ‘Add Project’ to create a new project.

  1. Enter the name of your project and click on continue.

  1. 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.

4.5.2 Setup Firebase & Admin SDK

  1. After creating the project, click on ‘Project Settings’ as shown in the image below.

  1. Click on ‘</>’ ‘Web app create’ button as shown in the image below.

  1. Enter the name of your Web App as shown in the image below and click on the ‘Register app’ button.

  1. 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)

  1. Now, click on the ‘Continue to Console’ button.

  1. Thereafter, click on service accounts as shown in the image below.

  1. 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.

4.5.3 Setup FCM SERVER KEY

  1. 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.

  1. Enable ‘Cloud Messaging’ as shown in the image below.

  1. Thereafter, Redirect to the Firebase Console tab and refresh the page.

  1. After refreshing the page, Get the server key as shown in the image below. Add this server key in your FCM_SERVER_KEY in the form field.

Last updated