Understanding the Different Types of FCM Messages

efe budak
4 min readJan 7, 2023
Photo by Museums Victoria on Unsplash

In this blog post, we will simplify the different types of messages that can be received by your Android applications using Firebase Cloud Messaging (FCM). Knowing how the Firebase SDK handles these message types can save you time debugging and improve your app’s functionality. If you need help integrating FCM, the official documentation provides a step-by-step guide (https://firebase.google.com/docs/cloud-messaging/android/client). Let’s get started.

App state

There are two different states the app can be in from the point of FCM messages; foreground and background. Based on the app state the FCM messages behave differently. We’ll see the matrix that’ll simplify the overall behavior of the messages so for now knowing the app state is going to be in that matrix is enough.

Photo by Kristina Flour on Unsplash

Data messages (a.k.a. silent notifications)

This is the simple one. The main purpose of this message type is to simply pass along some …drumroll please… data. The firebase SDK will simply call the onMessageReceived method so you will have the chance to handle the data you receive.

--

--

efe budak
efe budak

No responses yet