Android Push Notifications
We have recently migrated our push notifications servers to a bigger, better and faster one in order to accommodate for our increasing userbase. While testing, we found out that Android devices are not receiving all the push notifications that we were sending. After some research, we learned about Android’s battery optimization practice called Doze and Standby. So if you are reading this, below is a very quick summary of what it is and what it means to you.
Doze and Standy
Starting from Android 6.0 [Marshmallow], Android introduces two power-saving features that extend battery life for users … Doze reduces battery consumption by deferring background CPU and network activity for apps when the device is unused for long periods of time. App Standby defers background network activity for apps with which the user has not recently interacted.
https://developer.android.com/training/monitoring-device-state/doze-standby
What it means is that if you do not use your mobile phone for a while, your phone goes to Doze and if you do not interact with Aussie Bargain for a while, it goes to Standby mode. In both cases, any network (including receiving notifications) will be deferred to certain window of time.
This is done in order to save battery for users by limiting network calls by only providing a small window to connect. The time between each window increases exponentially the longer you do not use your phone. Your phone leaves the Doze / Standby mode if you use your phone / Aussie Bargain which then enables all notifications to be received.
Now what?
Well, glad you asked. Now that you know what Doze and Standby is. Let’s talk about what we can do and what you can do. We would also like to know your opinion on how to proceed.
Doze
When we send out push notifications at the moment, we are sending it with Normal priority, which is like most notifications. When your phone is in doze (meaning, you didn’t touch your phone for a while), notifications will be deferred to the next window of maintenance. We can however change that to send our notifications with High priority which will be able to call for network and guarantee message delivery. But that comes at a cost of slightly increased battery usage (3-5% per day?). What do you think of that?
App Standby
When you do not use Aussie Bargain for a while (varies depending on phones) or did not interact with any of the notifications received (Tap or snooze?), Android will place the app in App Standby mode. There are four buckets that the app can go into. ACTIVE, WORKING_SET, FREQUENT and RARE. When the app is in ACTIVE or WORKING_SET, no problem. When it reaches FREQUENT and RARE notifications may be discarded on your end. (To find out about an app standby status, go to developer options and look for Standby apps). This is more severe than Doze as we are limited in being able to lift your phone out of App Standby. There are three ways this can happen:
- Easiest one: Use Aussie Bargain =). Launching the app places the app in the Active ensuring you get all notifications.
- High Priority Message. If Aussie Bargain is in the FREQUENT or RARE bucket, it is limited in a sense that we can only request for network up to a maximum of 10 times per day (in FREQUENT) or 5 times a day (in RARE) even on High priority messages. This means you will get at most 10 deal notifications per day (1 hour of OzB?).
- You whitelist Aussie Bargain to allow access to call for network even in doze or standby. This means to disable battery optimization specifically for Aussie Bargain. You can do so by manually going to:
Users can manually configure the whitelist in Settings > Battery > Battery Optimization. (Source).
Or we can include a feature to request for permission to do so in a future version.
What do you think of that?
There you have it folks. We thought we would inform you of this issue we have and decide on how to move forward in order to better serve you. If you have any question / suggestions, please do not hesitate to contact us.
1 Comment
Android 14 Inexact Notification – 2iins · September 19, 2024 at 11:32 pm
[…] in order to help users save battery. This follows an article we have written almost 5 years ago https://www.2iins.com/blog/android-notification-doze/ which outlines doze and […]