Firebase Cloud Messaging (FCM) is a free messaging solution that lets you send web push notifications to your mobile app users. Firebase serves as a module between your server and the devices that will be receiving the push notifications that you create. Your server informs Firebase that a notification has to be sent. Then Firebase does the work behind the scenes to get the notification published.
Follow the below mentioned steps to use FCM:
Sign up on Google Cloud
- Go to Google Cloud.
- Click on Get Started for free.
- The following window appears. Select the checkbox to agree to terms and click on Agree and Continue button.
- In the next step, you can edit your account type and tax information. Also provide your name, address and card details here.
- Click on the Start my Free Trial button to start your free trial.
Please note that you won’t be charged unless you manually upgrade to a paid account. You will get $300 to spend on Google Cloud Platform over the next 12 months.
Creating a Project
- Go to Google Firebase Console.
- Click on Add Project.
- In the pop-up window opened, select the Project Name from the drop-down. Select the checkbox to agree to the tems and conditions.
- Click on Add Firebase button.
- The Firebase dashboard is then displayed as follows.
Creating an Android Project
- In the Firebase dashboard, click on the Android icon to create an android project.
- In the next step, you are required to register your app.
- Enter the Android package name and click on the Register app button.
- Now, download the configuration file and click on Next.
- Click on Skip the steps.
- Go to Mobile Apps > Mobile Apps section the StoreHippo Admin Panel.
- In the General section, find the Push notification field. Upload the configuration file in the Android field.
Obtaining Server Key
- In the Firebase dashboard, go to the app settings.
- Go to the Cloud Messaging tab.
- In the Product Credentials, copy the Server Key as shown above.
- Go to Mobile Apps > Mobile Apps section the StoreHippo Admin Panel.
- In the General section, find the Push notification field. Paste the Server Key.