Android How to's iOS

Firebase Cloud Messaging Android

Firebase Cloud Messaging

Firebase Cloud Messaging (FCM) is a cross-platform messaging solution that lets you reliably deliver messages to Android/iOS devices at no cost.

Using FCM, you can notify a client app that new email or other data is available to sync. You can send the notification messages to drive user reengagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4KB to a client app.

Supported platforms:

  • Android
  • iOS
  • C++
  • Unity
  • Web

Set Up a Firebase Cloud Messaging Client in APP

For integrating FCM with Android, the minimum required version is 2.3 or 2.3+ and app should be available in play store or run on the emulator.

Set up FCM project creation and setup notification.

  • Go to Add your App in firebase. Login or create a new account.
  • Then create your Project into FCM. Create project → Select Name and Country
  • It will Redirect you to set up page, here you can handle notifications, analytics, etc.
  • Then you select notifications in the left corner.

step1

  • After notifications selection, firebase will ask you select your platform (eg:Android or ios).
  • In this tutorial, I’m selecting my platform as Android. Then Firebase will ask your App package name(mandatory), nickname and SHA-1. This is the link for your APP and Firebase Cloud.

step3

  • After Added your App firebase automatically will download google-services.json file.if you open this file you can find the project number,firebase URL, OAuth client, API key, etc., in JSON format. This file uses to link your Application with firebase cloud.
  • Now you are ready to take the file and insert into your Android Application.Refer the following screenshot.

MyApplication-->app-->paste google-services.json.

                                               MyApplication–>app–>paste google-services.json

  • After gives continue Firebase will go for end stage.There they will explain about grade implementations.if you give finish it will come to notification sending the part.

Manually sending the Notification

  • Now Firebase will show you to send the notifications. Choose the process it will take you to Compose message page, here you add following items in the image.

step8

  • Customize your message and choose your package name which I highlighted in the above screenshot. Then select Send message now you will get your first notification.

notification1notification

 

 

 

 

 

 

 

 

 

Implementation of Firebase Cloud Messaging in Android.

I hope this tutorial helps you in creating your Notification messages. For iOS the process will vary but the method is same. For more info click here. If you have any questions please post in comments section.

About the author

Saigowtham T.K.

Saigowtham is an Android software engineer in KL, Malaysia. Saigowtham is well known for his vast experience in hybrid mobile development and industry exposure to manufacturing, advertisements and mobile gaming. Saigowtham possesses good knowledge in SDLC, Analytics, and Agile methodologies. Saigowtham interest to learn all new technologies and to review gadgets.

Leave a Reply

%d bloggers like this: