Set and manage Android message priority Stay organized with collections Save and categorize content based on your preferences.
You have two options for assigning delivery priority to downstream messages on Android: normal and high priority. Delivery of normal and high priority messages works like this:
Normal priority. This is the default priority for data and notification messages. Normal priority messages are delivered immediately when the device is not sleeping. When the device is inDoze mode, delivery may be delayed to conserve battery until the device exits doze. For less time-sensitive messages, such as notifications of new email, keeping your UI in sync, or syncing app data in the background, choose normal delivery priority.
High priority.FCM attempts to deliver high prioritymessages immediately, allowingFCM to wake a sleeping device whennecessary and to run some limited processing (including very limited networkaccess). High priority messages generally should result in user interaction with your app or its notifications.
Deciding between high and normal priority messages
While normal priority messages are suitable for general updates, choose highpriority when you need to ensure immediate delivery for urgent matters oractions. Since the delivery time for normal priority messages can be impacted byDoze mode, setting most of your user visible notifications to high priority willensure they are delivered promptly. For example, notifications such as, chatmessages, problems with an account, or food delivery updates, should be set tohigh priority.
Message processing for high and normal priority messages
For both high priority and normal priority messages received on an Androiddevice, several seconds are given to process the message payload in theonMessageReceived handler, with slightly more time allocated for high prioritymessages than normal priority ones. This time is only expected to be long enoughto immediately render a notification. If you have to do any additional work suchas loading an image from device storage or calling your servers to collectadditional content you will need to take additional steps.
TheonMessageReceived method is called on a separate worker thread. As bestpractice, you should process the message payload and display a notificationimmediately within theonMessageReceived method. You shouldn't be makingadditional asynchronous network calls or doing payload processing on a separatethread within theonMessageReceived method, doing so can cause yourapplication to be outside of avalid process lifecyclebefore the payload is fully processed. If this happens, you may see that certainFCM messages that are sent result in delayed or missing notifications.
If you do need additional time to process for your message, for example to fetchanimageUrl contained in your message payload, you will need to use aconstruct such asWorkManager or foreground service to extend the applicationlifecycle. You should use the following guidance when youoverride theonMessageReceived methodto verify your notifications are fully processed.
- For high priority notifications: Start anexpedited jobusing the Android
WorkManagerto verify that your high prioritynotification gets prioritized processing time to verify your notificationrendering runs to completion. The good news is that if you're worried aboutexhaustingexpedited job quotasas a result of high priority FCM processing, you don't need to be. There isa brief exemption for expedited jobs scheduled immediately after a highpriority FCMonMessageReceivedis dispatched. - For normal priority notifications: Start aregular
WorkRequestusing the AndroidWorkManagerinstead. This will verify that theadditional work required to process your notification gets processedeventually, without utilizing prioritized processing and causing unneededbattery usage issues.
Setting priority for messages
You can send notifications to your users using theAdmin SDK, theFCM REST API, and theFirebase console. To change your prioritysetting from theAdmin SDK and FCM REST API, you have to update the message JSON payload. Youcan use the following code sample to see how to set the priority to high. Fornotifications sent from the console, setting Android-specific notificationfields isn't supported.
{ "message": { "notification": { "body": "Purchase exceeding $500 detected", "title": "Credit card purchase" }, "data": { "purchaser": "Your child", "items": "Gravity Defier Sneakers" }, "android": { "priority": "high" }, "apns": { "headers": { "apns-priority": "5" } } }}Test your high priority notifications in Doze mode
To make sure your high priority notifications are being received and processedcorrectly when received by a user, follow these instructions to test yournotifications:
- Set your device to Doze mode using the instructions inTest your app with Doze.
- Access yourFCM registration token from your app on the testdevice. For more information on how to access the token, seeSend a test message to a background app.
- Once you have theFCM token, send your high priority notificationto the test device using yourFCM notification sending code or acURL commandthat has configuration parameters matching your high priority notification.
Deprioritization of high priorityFCM on Android
High priority messages on Android are meant for time sensitive, user visiblecontent, and should result in user-facing notifications. IfFCMdetects a pattern in which messages don't result in user-facing notifications,your messages may be deprioritized to normal priority ordelegatedfor handling by Google Play services.
FCM uses 7 daysof message behavior when determining whether to deprioritize or proxymessages; it makes this determination independently for every instance of yourapplication. If, in response to high priority messages, notifications aredisplayed in a way that is visible to the user, then your future high-prioritymessages won't be affected.
Notification delegation with Google Play services
High priority notification messages that meet certaincriteria are proxied by Google Play services instead of being deprioritized.This means that the notifications are displayed by Google Play services onbehalf of the app, without any need to start the app. This is done to provide abetter overall user experience on Android devices.
Note that proxied notification messages introduce changes in how analyticsrelated to messages being received are reported:
- In order for analyticsfor proxied notifications to be reported, your app must use FCM SDK version24.0.0 or higher.
- You may notice delays or drops in the number ofmessages received versus the number prior to the introduction of proxiednotifications. This is because analytics for proxied notifications are onlyreported once your app starts, and might not be reported at all if thenotification doesn't result in the app opening.
Proxying notification messages in this way is the default behavior for appsusing Android Q+ and Google Play services version 19054000 or later. Messagessent through HTTP v1 API are proxied, but messages sent through the Firebaseconsole or legacy APIswill not be proxied. Note that this feature iscurrently in Beta, and is subject to change.
Though we strongly recommend leaving delegation enabled for its benefits todevice battery and memory, you can opt out of this behavior in any of theseways:
- On an app-level basis: in your app manifest, add the directive
<meta-data android:name= "delivery_metrics_exported_to_big_query_enabled" android:value="false"/>. - On an app instance basis: For the app instance, set
fun setNotificationDelegationEnabled(disable: Boolean): Task<Void!>in the UI flow for your app, depending on the specific use case. - On a per-message basis: Set the
proxykey toDENYin theAndroidNotificationobject for the send request.
Measuring message deprioritization on Android
Individual Messages. On delivery, you can determine whether an individual message was deprioritized or not by comparing its delivered priority, fromgetPriority(), with its original priority, fromgetOriginalPriority().
All Messages. TheFCM Aggregate Delivery Data API can report what percentage of all your messages to Android are being deprioritized. Some messages may be omitted from the aggregate data reports, but overall they should give a global view of message deprioritization rates. See our article onaggregated delivery data for more information and sample code for querying the API; it can also be explored from theAPI explorer.
Proxied Notifications. Proxied notifications won't be counted in current FCM or GA delivery metrics, soyou may experience a drop of up to 15% in notification delivery metrics. Forreporting on proxied messages, use theFCM Aggregate Delivery Data API.
ProxyNotificationInsightPercentsreports the percentage of successfullyproxied notifications as well as details for messages that can't besuccessfully proxied.
Troubleshooting Notification Delays
Ensure that your app instance has notifications enabled. If the user has disabled the notification permission for your app, none of your notifications will be posted, as a result, your messages will be deprioritized. You shouldverify that notifications are enabled before sending high priority messages to an application instance.
Avoid making additional network calls when processing your notification. Because a small portion of the Android mobile population areon high latency networks, avoid opening a connection to your servers beforedisplaying a notification. Calling back to the server before the end of theallowed processing time may be risky for users on high latency networks.
Instead, include thenotification content in the FCM message and display it immediately. If you needto sync for additional in-app content on Android, you can schedule a task withWorkManager to handle that in the background.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.