Have you ever noticed that messages in some applications arrive instantly, while in others they arrive with a delay of several hours? This is not magic or an accident, but the result of complex work of system services Android. The message delivery mechanism we call “push” is the foundation of the modern mobile experience, keeping the user informed without the need to constantly open the application.

At the heart of this entire system is technology FCM (Firebase Cloud Messaging)developed by Google. It acts as an intermediary between the developer's server and your smartphone, ensuring energy-efficient data transfer. Understanding exactly how FCM interacts with the operating system will help you not only customize notifications for yourself, but also diagnose problems with their receipt.

Next we will analyze in detail the architecture of this system, the impact of the power saving mode and ways to force notifications for critical applications. You will find out why your phone's battery does not drain instantly, despite the constant flow of incoming data.

Message delivery architecture via FCM

Push notifications are based on a client-server architecture, where your smartphone acts as a client. When you install an application, it requests a unique token identifier from the service. This token is sent to the developer's server and is used as an address for sending messages specifically to your device. Google Play Services unique token identifier. This token is sent to the developer's server and is used as an address for sending messages specifically to your device.

The server sends the data packet not directly to the application, but to the system service FCM. This is a critical point: the application can be completely closed or unloaded from RAM, but the message will still be delivered. The system service receives the packet, wakes up the target application and sends the notification content to it.

This approach achieves high energy efficiency. Instead of each of the hundreds of installed apps maintaining their own constant connection to the Internet (which would quickly drain the battery), they all use a single secure channel. Google Play Services.

💡

If you're developing an app, use high-priority messages only for really important events, as the system may limit their frequency to save battery.

  • 📱 The app requests a registration token the first time startup.
  • ☁️ The token is saved on the developer's server for targeted distribution.
  • 📨 The server sends a message to the Firebase cloud indicating the recipient's token.
  • ⚙️ The FCM service on the device receives the message and activates the application.

Impact of Doze mode and battery optimization

Starting with version Android 6.0 Marshmallow, the system has introduced aggressive power saving mechanisms, known as mode Doze. When the phone is lying still and the screen is turned off, the system postpones network activity of applications, synchronization and background tasks. This may result in delays in delivery of push notifications.

However, high priority messages have an exception. They can wake up the device even in deep sleep mode. The problem occurs when the app itself gets included in the battery optimization list. In this case, the system can completely block the background operation of the application, ignoring even incoming signals from FCM until the user manually opens the app.

⚠️ Attention: On smartphones from different manufacturers (Xiaomi, Huawei, Samsung) there are additional, more stringent layers of optimization on top of standard Android. They can kill application processes immediately after being minimized, blocking the receipt of push notifications.

To ensure timely receipt of important alerts, it is necessary to exclude the application from the optimization list. This is done through the battery settings, where the “No restrictions” or “Do not optimize” mode is selected for a specific application.

☑️ Setting up battery exceptions

Completed: 0 / 1

Notification channels and priority management

In modern versions Android developers are required to distribute notifications across channels. A channel is a category of messages with specific settings for sound, vibration, and importance. The user can fine-tune each channel separately, turning off, for example, marketing mailings, but leaving sounds for personal messages.

The importance level (Importance) determines how exactly the system will process the incoming message. There are several levels: from no sound at all and no pop-up window to a priority notification that appears on top of other applications. If the severity is set to the minimum level, you may not even see the status bar icon.

Severity Level Sound Pop-up window Status bar icon
High (High) Yes Yes Yes
Average (Default) Yes No Yes
Low No No Yes
Minimum (Min) No No No (hidden)

Channel control is carried out through a long tap on the notification in the curtain. This allows you to quickly go to the settings of a specific type of alert. It is important to understand that global disabling of notifications for an application overrides the settings of individual channels.

📊 How do you feel about advertising push notifications?
I disable them completely
I leave only discounts
I don’t care
I read everything

Delivery problems on custom firmware

Owners of smartphone brands Xiaomi (MIUI/HyperOS), Huawei (EMUI) i Samsung (One UI) often face a situation where notifications do not arrive until the application is open. This is due to the fact that manufacturers modify the standard behavior of Android, introducing their own task managers that aggressively terminate background processes to save memory.

On such systems, it is not enough to simply configure notifications in the Applications section. It is required to pin the application in memory (blocking recent tasks) and grant the right to autorun. Without these actions, the system may consider the application unused and stop its network activity.

Specifics of MIUI operation

In Xiaomi firmware there is a hidden “Autorun” list, access to which is often deep in the security settings. If the application is not added there manually, push notifications may not work even if you have permission for notifications.

It is also worth checking the traffic saving settings. If an application has a limit on background data transfer, it will not be able to connect to the server FCM at the right time. Make sure that background mode and roaming are enabled in the “Data transfer” item if you travel frequently.

Diagnostics and logging using ADB

For advanced users and developers, there is a tool Android Debug Bridge (ADB)that allows you to (view) the registration status of the device in the notification service. Using the command line, you can check whether the system sees the application as registered to receive push notifications.

The command adb shell dumpsys firebase_messaging displays detailed information about the status of the FCM service, including the history of sent and received messages. This helps to understand whether the message reached the phone, but was filtered by the system, or whether it was lost at the stage of sending by the server.

adb shell dumpsys package com.example.app | grep -A 5"receivers"

Using such commands requires enabling USB debugging in the menu For developers. Be careful when changing system parameters through ADB, as incorrect commands can lead to unstable operation of system services.

💡

If the dumpsys command shows an empty list of messages, the problem is on the developer server or network side, and not in your phone settings.

The role of tokens and reinstallation applications

Every time you reinstall an application or clear its data, a new registration token is generated. The old token becomes invalid. If the development server continues to try to send a message to the old address, delivery will not occur. When the application is first launched, it must send a new token to its backend.

Sometimes this mechanism fails. For example, if an application was deleted and then restored from a backup, it might try to use the old token. In such cases, forced clearing of application data and re-authorization helps, which initiates a request for a new key from Google Play Services.

It is also worth mentioning resetting the advertising identifier. Although it is (mostly) for targeting, some implementations of analytics systems can indirectly influence the logic of push services by associating a device token with a user profile.

⚠️ Attention: Settings interfaces and menu item names may differ depending on the version of Android and the manufacturer's shell. If you do not find the specified option, use the settings search.

Frequently asked questions

Why do notifications only come after opening the application?

Most likely, the application is limited in background operation by energy saving settings. Check the Battery section in your phone settings and select the Unlimited mode for the problematic app. Also make sure that autorun is enabled.

Is it possible to receive push notifications without a Google account?

On standard Android devices, the FCM service depends on Google Play Services. Without logging into your Google account and having services, Push notifications will not work. The exception is some Chinese firmware with their own alternative services.

How to disable push notifications from only one channel, and not the entire application?

Make a long tap (press) on the notification that arrives. From the menu that appears, select Turn Off Notifications or Settings. There you can disable a specific category (channel), leaving the rest active.

Does Do Not Disturb mode affect the receipt of push notifications?

Do Not Disturb mode usually hides sound and vibration, and can also hide notification content from the lock screen. However, the message itself technically arrives on the device and is stored in the curtain, unless complete blocking of notifications is configured.