Introduction To Firebase And Getting Firebase Credentials - Key(s)

What is Firebase Cloud Messaging?

 
Firebase Cloud Messaging Platform (formerly named as GCM) is a no-cost free notification service provided by Google which enables (third-party or cross-platform) app developers to send notifications from GCM (Google Cloud Messaging) servers to their users.
 

How does it work?

 
FCM requires sending and receiver services to share cross-platform notification service.
 
It needs an iOS, Android, or any web (JavaScript) client app which will receive messages via transport service from the corresponding platform . A trusted environment is a cloud function for firebase on which applications are being built and targeted, and which will help us to send and receive messages.
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 

How many type(s) of push notifications are available? 

 
At its core, there are 4 types of scenarios in which Push Notifications get triggered for all apps.
  1. Immediate notifications
    As the name suggests, notifications get triggered after any certain operation or event or action gets fired.

    For example, real-time chat with your colleagues

  2. Scheduled notifications
    Whenever any job or batch or CRON is scheduled for a certain time, this kind of notifications service is used to acknowledge by triggering a notification.

    For example, any news update or a scheduled article update scheduled on the next day will get acknowledged by using FCM scheduled notification service.

  3. Scheduled notifications as a result of an action
    Whenever any action is triggered using a scheduled CRON job, after that action is triggered,  if a user wants to fire a notification after a certain time, then this kind of notification service is used.

    For example, John wants to trigger push notifications after 5 minutes once his salary is credited to his account.

  4. Local notifications
    As the name suggests, this is the notification which works as a scheduler JOB in the local device, like in case you want to  fire local notifications, then firebase will set up a CRON job in your local device and notifications are being triggered when certain actions are fired without the help of an internet connection.

    For example, for any reminder notification we don't require any internet connection, so using firebase service we can set a CRON job in the local device so that we can fire a push notification on the desired time as a reminder.

Configuration or Project Set-up in Firebase console


STEP 1
 
Create your firebase project from firebase console.

STEP 2
 
Register new account or try to log in with existing accout
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)

STEP 3
 
Once logged in, you can see firebase console dashboard. Click on Add Project. Provide a project name, and then select country and then after that click on Create Project. For example, see the below image.

Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
STEP 4
 
Once the project has been created, it will automatically redirect to Firebase dashboard screen
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
STEP 5
 
As React application is a web project,  you need to add web project/application to the firebase project.
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
STEP 6
 
As mentioned in an earlier image, you can add Firebase to your web app.
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
Once the web app been added into Firebase, you'll get a web app configuration Javascript code which you can add in the web application. Then you will be redirected to the web app dashboard screen.
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
Introduction To Firebase And Getting Firebase Credentials - Key(s)
 
STEP 7
 
There are a  few credentials which are required to configure Firebase on your web app.
  1. Server key
    On setting options, there is a navigation menu, Cloud Messaging. Click on that menu and you will get a server key.

    Introduction To Firebase And Getting Firebase Credentials - Key(s)

  2. Public Key
    There is another button to create a public key which lies under the same screen. On the Generate Key Pair button you can create a public key for your Firebase web app.

    Introduction To Firebase And Getting Firebase Credentials - Key(s)

    Introduction To Firebase And Getting Firebase Credentials - Key(s)

  3. General Configuration
    Firebase general configuration information will be recieved from General Tab.

    Introduction To Firebase And Getting Firebase Credentials - Key(s)

Summary

 
So this is how you can set-up or configure a Firebase project and web app in the Firebase console. In my next article we will learn Firebase configuration in React apps using Firebase credentials, and we will learn about Firebase push notification, number authentication and Firestore google cloud using Firebase service.