<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi" -->

---
title: Using Firebase Cloud Messaging with Android O | daily.dev
description: Android O introduces new background process optimizations that impose a guaranteed 10-second lifecycle limit on FCM's onMessageReceived() and onTokenRefresh()...
canonical: https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Using Firebase Cloud Messaging with Android O | daily.dev
og:description: Android O introduces new background process optimizations that impose a guaranteed 10-second lifecycle limit on FCM's onMessageReceived() and onTokenRefresh()...
og:url: https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi
og:image: https://api.daily.dev/og/posts/b28yTSzVi.png
og:image:alt: Using Firebase Cloud Messaging with Android O
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.

# Using Firebase Cloud Messaging with Android O

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

## Summary

Android O introduces new background process optimizations that impose a guaranteed 10-second lifecycle limit on FCM's onMessageReceived() and onTokenRefresh() callbacks, matching Broadcast Receiver behavior. Developers should keep operations inside these callbacks quick (like local database updates or showing notifications) and delegate longer tasks (image downloads, remote syncs) to JobScheduler or the Work Manager to avoid process termination. Requires Firebase SDK version 10.2.1 or later for Android O development.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://firebase.blog/posts/2017/03/using-firebase-cloud-messaging-with>

## Questions this post answers

### Why does my FCM onMessageReceived() callback get killed before finishing on Android O?

Android O limits FCM callbacks onMessageReceived() and onTokenRefresh() to a guaranteed lifecycle of only 10 seconds, the same as a Broadcast Receiver. After that period, the process becomes eligible for termination even if the callback code is still running. Perform only quick work like updating a local database inside the callback, and offload longer operations to JobScheduler or the Work Manager.

_daily.dev surfaces platform-level breaking changes like this for developers maintaining push notification code._

### What Firebase SDK version do I need for Android O development?

Version 10.2.1 or later of the Firebase SDK for Android is required for Android O development. This is in addition to installing the Android O Developer Preview SDKs from the official preview site before starting FCM integration work.

_track SDK version requirements like this on daily.dev when prepping an Android O migration._

### How should I trigger long-running background operations from an FCM data message?

Use the Work Manager to schedule the operation, rather than running it directly inside the FCM callback. This lets Android pick the best time to run the task, such as avoiding extra work when battery is low or CPU is heavily used, while the callback itself completes within its 10-second limit.

_developers designing background sync flows can follow work like this via 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
- [Android 17 \(API Level 37\): Everything Android Developers Need to Know](https://daily.dev/posts/android-17-api-level-37-everything-android-developers-need-to-know-lhokkvwyx) · Medium · 17 upvotes · 2 comments
- [Beyond Doze: Building Reliable Background Execution on Modern Android \(Including OEM Realities\)](https://daily.dev/posts/beyond-doze-building-reliable-background-execution-on-modern-android-including-oem-realities--b4bmxjjrv) · ProAndroidDev · 1 upvotes · 0 comments
- [Android 13’s Hidden Requirement: Notification Permission for Background Services](https://daily.dev/posts/android-13-s-hidden-requirement-notification-permission-for-background-services-jc6jjj8u7) · Medium · 0 upvotes · 0 comments
- [Stop Shipping Stale Data: Backend-Driven Cache Updates on Android](https://daily.dev/posts/stop-shipping-stale-data-backend-driven-cache-updates-on-android-fat6dcn4o) · ProAndroidDev · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi)

```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":"Using Firebase Cloud Messaging with Android O","url":"https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi"},"datePublished":"2026-08-23T12:21:51.049Z","dateModified":"2026-08-23T12:48:29.880Z","description":"Android O introduces new background process optimizations that impose a guaranteed 10-second lifecycle limit on FCM's onMessageReceived() and onTokenRefresh()...","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/using-firebase-cloud-messaging-with-android-o-b28ytszvi","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"android","timeRequired":"PT3M"}
{"@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":"Using Firebase Cloud Messaging with Android O"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/using-firebase-cloud-messaging-with-android-o-b28ytszvi#faq","mainEntity":[{"@type":"Question","name":"Why does my FCM onMessageReceived() callback get killed before finishing on Android O?","acceptedAnswer":{"@type":"Answer","text":"Android O limits FCM callbacks onMessageReceived() and onTokenRefresh() to a guaranteed lifecycle of only 10 seconds, the same as a Broadcast Receiver. After that period, the process becomes eligible for termination even if the callback code is still running. Perform only quick work like updating a local database inside the callback, and offload longer operations to JobScheduler or the Work Manager. daily.dev surfaces platform-level breaking changes like this for developers maintaining push notification code."}},{"@type":"Question","name":"What Firebase SDK version do I need for Android O development?","acceptedAnswer":{"@type":"Answer","text":"Version 10.2.1 or later of the Firebase SDK for Android is required for Android O development. This is in addition to installing the Android O Developer Preview SDKs from the official preview site before starting FCM integration work. track SDK version requirements like this on daily.dev when prepping an Android O migration."}},{"@type":"Question","name":"How should I trigger long-running background operations from an FCM data message?","acceptedAnswer":{"@type":"Answer","text":"Use the Work Manager to schedule the operation, rather than running it directly inside the FCM callback. This lets Android pick the best time to run the task, such as avoiding extra work when battery is low or CPU is heavily used, while the callback itself completes within its 10-second limit. developers designing background sync flows can follow work like this via daily.dev."}}]}
```

