FCM SDK Push Notification Rendering Under Battery Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current push services are hindered by battery optimization in user's communication devices, leading to notifications not being rendered on the screen despite being delivered.
Innovation Solution
A software development kit (SDK) that utilizes Firebase Cloud Messaging (FCM) APIs to send notifications, listens for intents, and renders them on the device, even with battery optimizations enabled, preventing ANR errors and ensuring delivery to the user.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Use of energy by moving object
If battery optimization is enabled in the communication device, then energy consumption is reduced, but push notifications cannot be rendered on the screen
Solution Approach 1:
The SDK performs preliminary actions by registering broadcast receivers and setting up intent filters in advance. This allows the system to preemptively establish the necessary components for notification rendering before battery optimization modes are activated, ensuring that notification handling capabilities are already in place and can operate independently of battery optimization restrictions
Solution Approach 2:
The SDK acts as an intermediary layer between the FCM server and the device's notification system. It receives push notification data from FCM, processes it through broadcast receivers, and transforms it into a format that can be rendered by the device's notification manager. This intermediary mechanism bypasses battery optimization restrictions by using standard Android broadcast intents that are not subject to the same power management constraints
2Device complexity
If fire-and-forget method is used for sending notification requests, then system complexity is reduced, but notifications may not be rendered due to battery optimization
Solution Approach 1:
The notification delivery process is segmented into distinct functional components: the FCM server for data transmission, the broadcast receiver for intent listening, the SDK for processing and transformation, and the notification manager for rendering. This segmentation allows each component to operate independently with well-defined interfaces, maintaining simplicity while ensuring reliable delivery through specialized handling at each stage
Solution Approach 2:
The system implements feedback mechanisms through broadcast receivers that listen for intent broadcasts. When a push notification is received, the receiver processes the intent and provides feedback by triggering the rendering process. This feedback loop ensures that notifications are reliably delivered and rendered, compensating for the simplicity of the fire-and-forget sending method
3Ease of operation
If standard push notification delivery is used, then ease of operation is maintained, but ANR errors occur on devices with battery optimization enabled
Solution Approach 1:
The SDK provides beforehand cushioning by implementing error handling and fallback mechanisms in advance. It prepares alternative rendering paths and handles potential ANR errors through try-catch blocks and timeout management. This cushioning ensures that even if standard delivery encounters issues due to battery optimization, the system can gracefully handle the situation without crashing or causing ANR errors
Data Source
AI summary
The present disclosure provides a method and system to render the push notifications in a communication device of a user. The present disclosure includes a software development kit. The SDK works even when the battery optimization in the communication are turned on. The present disclosure has dedicated server allocations. Servers use firebase cloud messaging APIs to send a notification to the communication device. The FCM servers send the notification downstream to the one or more communication device's operating system to broadcast an intent. This intent is listened by the firebase cloud messaging software development kit installed in a memory of the communication device. The SDK passes the notification payload to a notification service of an application and the notification is rendered. Further, the present disclosure prevents ANR errors and may enable the FCM service in devices that may have not supported FCM service previously.


