Adding Firebase Cloud Messaging to Android - A Savvy Guide

Adding Firebase Cloud Messaging(FCM) to Android App

Adding Firebase Cloud Messaging(FCM) to Android App

Android Firebase Cloud Messaging is a free platform provided by Google. Firebase cloud Messaging is often called as FCM by the Developers, previously it is GCM which is Google Cloud Messaging and from last year Google recommended developers to use FCM instead of GCM . FCM(Firebase console messaging) which includes many free services which are useful for the android developers and IOS developers to implement complicated things in a single set of instruction by writing a little bit of code and a little bit of clicks for setup. Understanding Firebase cloud messaging is very easy and simple all you need to know is just a little bit of android knowledge which you have previously developed any application for the understand how to create a project, if you haven’t developed then there is a simple and simple set of instructions which makes beginners level of programmer to understand it easily and advanced level android developer to teach for the new beginner level programmers.

Adding Android Firebase to Google App with error free

Android Firebase Error Free:

Before Implementing lets make sure you have updated your google play services, and your sdk is updated up to date if its not then go ahead and updated it if not you will be facing error while doing the below procedure. After you update then we are good to go.

Implementing Android Firebase Push Notification:

Steps to follow: Go grab an account of Firebase here : which takes normal registration only which is free of cost provided by Google, you can do a lot more things and improve your app performance by using this Firebase Cloud Messaging.

After completing Registration of Firebase:

When you are done with Step one which is registration then open your Android studio and start a new project with your desired project name, make a note of your project id name as we will be in need of it in firebase we have to mention our package name in firebase so Google takes care of everything with your android app package name.

Register your Android App in Firebase Console:

Very easy to register your android app in firebase well lot of developers will be scary and facing trouble for the first time we will be going everything step by step deeply with proper explanations.

Create a new project in Firebase and name it with your desired name in console and press next and then you will be seeing options to add a IOS App or Add a Android App. Here we will be covering Android App. Select android app and you will be prompted to give a package name of your android application. Give your package name and select your country and leave the shah key for now we will be covering that in next tutorial. After pressing next you will be asked to download a file named: googleservices.json file which is very important, just download it and keep in the project level app folder. Check below image to get more clear where to add that file and add the dependencies of firebase in gradle file in module level and also apply the plugin at the end of app gradle file. That’s it you are done with the firebase adding / registering / connecting it to the app.

After completing the above process sync your gradle file and you are done. You have successfully registered you app with firebase our next step is to send a firebase Push notification to our android application.

Possible Errors you will be facing:

While adding you will be facing a well know and possible errors which every developer will be making including me at the beginning level of my Android Programming.

Make sure you are using latest version of the firebase console dependencies, make sure they are added in the right paths, make sure you are adding the same package name.