Android How to's

Implementation of Firebase Cloud Messaging in Android

FCM clients require devices running Android 2.3 or higher that also have the Google Play Store app installed, or an emulator running Android 2.3 with Google APIs. Note that you are not limited to deploying your Android apps through Google Play Store.

Set up Firebase and the FCM SDK

  • First step want to insert google-services.json file in your App. For this tutorial please refer my previous post Firebase Cloud Messaging Android.
  • After that insert Firebase and google sdk in your gradle.

    1.compile ‘’

2.apply plugin: ‘’

Please refer this image.


  • Now go to your root level build.gradle file and add your google services class path.

              classpath ‘’



Change your Manifest 

  • Manifest you want to add FirebaseMessagingService. This is helps to handling your notifications in background. To receive notifications in foregrounded apps, to receive data payload, to send upstream messages, and so on, you must extend this service.
  • Then you want add FirebaseInstanceIdService to handle the creation, rotation, and updating of registration tokens. This is required for sending to specific devices or for creating device groups.


FireBase messaging Implementation in APP

  • Create Background FireBase message service class.


  • Create New FireBaseinstanceid class.


  • Finish your process in Application side. just run your app now.
  • you will get New token check your log cat.

For full source code please click this link

Firebase Cloud Messaging Android

I hope this tutorial helps you in creating your first FCM Notification App. 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: