So lets start :-
Before We Start
You'll need the following:- The latest stable Android Studio
- A Firebase account
1. Get started
Add a new project or import an existing project to Firebase console.Click the ADD APP button here to download google-services.json. This is an important file and you will need to put it into your app.
2. Add google-services.json to your app folder
Replace the google-services.json in your app folder. The Google services plugin for Gradle will load the google-services.json file you just downloaded.
3. Configure gradle files
Open Android Studio and modify your build.gradle files to use the Google services plugin.
Now Update the project-level build.gradle
Add the following line to the build.gradle file:
Now Update the app-level build.gradle
Add this line to the bottom of the build.gradle file4. Add services to your app
Two services(java Activity) will be added to use Messaging service both are given below(1) FirebaseMessagingService.java
To be able to receive any notification in your app, you should add a service which extends FirebaseMessagingService like this:(2) FirebaseInstanceIdService.java
Add it into the AndroidManifest.xml file
5. Test and send your first push notification!
To see if the setup works, run a test by sending a test message to your own mobile.If the setup is successful, you should get a notification on your mobile.
That's All for this post and Thanks for visiting and thanks for your time if you have any suggestions and want to share any feed back then comment down below and if you face any issue then let me know in the comment section also share this with your friends