<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk" -->

---
title: Handle FCM messages on Android | daily.dev
description: A practical guide to handling Firebase Cloud Messaging (FCM) on Android, covering the difference between notification messages and data messages, how each is...
canonical: https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Handle FCM messages on Android | daily.dev
og:description: A practical guide to handling Firebase Cloud Messaging (FCM) on Android, covering the difference between notification messages and data messages, how each is...
og:url: https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk
og:image: https://api.daily.dev/og/posts/3cZrbU9Mk.png
og:image:alt: Handle FCM messages on Android
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Handle FCM messages on Android

**[Firebase](https://daily.dev/sources/firebase-blog)** · 6 min read · 0 upvotes · 0 comments

## Summary

A practical guide to handling Firebase Cloud Messaging (FCM) on Android, covering the difference between notification messages and data messages, how each is delivered depending on app foreground/background state, and recommended workflows for posting notifications, decrypting payloads, and scheduling background work with WorkManager or JobScheduler. Includes Kotlin code samples for implementing onMessageReceived() in a FirebaseMessagingService. Also notes that Google Cloud Messaging (GCM) server and client APIs were deprecated in April 2018 and slated for removal by April 11, 2019, urging developers still on GCM or the earlier C2DM library to migrate to FCM.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://firebase.blog/posts/2018/09/handle-fcm-messages-on-android>

## Questions this post answers

### When will Google Cloud Messaging (GCM) server and client APIs be removed?

Google Cloud Messaging (GCM) server and client APIs were deprecated in April 2018 and were scheduled to be removed as soon as April 11th, 2019. Developers still using GCM needed to migrate to Firebase Cloud Messaging (FCM) before that removal date, since GCM would no longer function afterward.

_Track migration deadlines like the GCM to FCM cutover with daily.dev before they break your app._

### How long does the FCM onMessageReceived() handler have to process a message on Android?

The FCM handler has approximately 20 seconds once a message is received to complete short tasks such as posting a notification. For anything that takes longer, developers should schedule a job or use the WorkManager API instead of blocking the onMessageReceived() callback, since it is only designed for quick execution.

_daily.dev helps Android developers stay current on best practices like FCM message handling limits._

### What is the difference between FCM notification messages and data messages on Android?

Notification messages are high priority by default and, when the app is in the background, are automatically shown by the Android system without app code running, while in the foreground they go to onMessageReceived(). Data messages are normal priority by default, always require handling in onMessageReceived(), and carry a payload up to 4KB that the developer must process and display manually.

_Developers deciding between FCM message types can follow implementation guidance like this on daily.dev._

## Similar posts on daily.dev

- [When Notifications Became Data Trucks: A Real-World Crash Story from Firebase FCM](https://daily.dev/posts/when-notifications-became-data-trucks-a-real-world-crash-story-from-firebase-fcm-nh9ixqylv) · ProAndroidDev · 1 upvotes · 0 comments
- [Deep Linking and Navigation from Notifications](https://daily.dev/posts/deep-linking-and-navigation-from-notifications-zyqz11wln) · Medium · 0 upvotes · 0 comments
- [Mobile Background Execution: iOS Background Modes, Android WorkManager, and Background Services in Dart](https://daily.dev/posts/mobile-background-execution-ios-background-modes-android-workmanager-and-background-services-in-d-w1iht51fd) · freeCodeCamp · 2 upvotes · 0 comments

---

Tags: [#android](https://daily.dev/tags/android), [#kotlin](https://daily.dev/tags/kotlin)

[View this post on daily.dev](https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Handle FCM messages on Android","url":"https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk"},"datePublished":"2026-08-23T12:19:27.958Z","dateModified":"2026-08-23T12:32:30.846Z","description":"A practical guide to handling Firebase Cloud Messaging (FCM) on Android, covering the difference between notification messages and data messages, how each is...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7ed721de96163685d26ab7e314be3ebc?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7ed721de96163685d26ab7e314be3ebc?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Firebase","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Firebase","logo":"https://media.daily.dev/image/upload/s--i395oqZH--/f_auto,q_auto/v1787487448/logos/firebase-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/firebase-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"android,kotlin","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Firebase","item":"https://daily.dev/sources/firebase-blog"},{"@type":"ListItem","position":3,"name":"Handle FCM messages on Android"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/handle-fcm-messages-on-android-3czrbu9mk#faq","mainEntity":[{"@type":"Question","name":"When will Google Cloud Messaging (GCM) server and client APIs be removed?","acceptedAnswer":{"@type":"Answer","text":"Google Cloud Messaging (GCM) server and client APIs were deprecated in April 2018 and were scheduled to be removed as soon as April 11th, 2019. Developers still using GCM needed to migrate to Firebase Cloud Messaging (FCM) before that removal date, since GCM would no longer function afterward. Track migration deadlines like the GCM to FCM cutover with daily.dev before they break your app."}},{"@type":"Question","name":"How long does the FCM onMessageReceived() handler have to process a message on Android?","acceptedAnswer":{"@type":"Answer","text":"The FCM handler has approximately 20 seconds once a message is received to complete short tasks such as posting a notification. For anything that takes longer, developers should schedule a job or use the WorkManager API instead of blocking the onMessageReceived() callback, since it is only designed for quick execution. daily.dev helps Android developers stay current on best practices like FCM message handling limits."}},{"@type":"Question","name":"What is the difference between FCM notification messages and data messages on Android?","acceptedAnswer":{"@type":"Answer","text":"Notification messages are high priority by default and, when the app is in the background, are automatically shown by the Android system without app code running, while in the foreground they go to onMessageReceived(). Data messages are normal priority by default, always require handling in onMessageReceived(), and carry a payload up to 4KB that the developer must process and display manually. Developers deciding between FCM message types can follow implementation guidance like this on daily.dev."}}]}
```

