Fix: Why your push notifications aren't working on some Android devices and stock roms

ID ~ inc
Technology | Tech
If you are having problems with your push notification not working 'properly' on some android devices then you are not alone.
This is a problem android app developers are currently battling with. These problems have been reported to exist on many third-party stock ROMs and some device manufacturers like Infinix, Xiami, Tecno, Itel, Oppo, Sony, Vivo, Huawei, and Samsung.

The problem
This problem is experienced when your application is closed from the Recents screen, or when the device is Rebooted.
The only time your app seems to receive notifications is when the application is opened or running in the background when the Home button is pressed.
Sending notifications using Onesignal shows that your notifications have been delivered but for some reason, your app subscribers aren't seeing it in reality even though Onesignal shows delivered. This problem defeats the purpose of many applications looking to use notifications to grow engagements and drive relevance.

But why are popular apps like Whatsapp, Gmail, Youtube, and Telegram all working under the above-mentioned conditions? Well, it turns out third-party manufacturers have them whitelisted by default.
If you go to settings > auto-start apps on your device, you will notice that these applications are allowed to auto start by default. These third-party OEM's have them whitelisted.

This problem arose from stock ROMs as a way of trying to optimize battery consumption but turned out to be more of a problem. Apps like Greenify that aims to manage and optimize device operations have also been reported to have apps notification services suspended.

The Solution
There are two ways to solving this problem, which to many including myself is not really the best.
Manually directing users to go to settings>auto-start app menu. To turn on automatic start for your app. Tasking users to go through these steps can stressful given the low attention span users have these days. They simply uninstall after a while which is every developer's nightmare.
Programmatically redirecting the to the auto-start menu in settings. This approach isn't quite really the best as manufacturers do not have these options under a particular menu. Also, tracking whether the application has its auto-start option active seems impossible.

The open-source nature of the Android OS does have it's advantages but these tweaks to the OS has sure become a major problem that has made developers lives a living hell.

If you have a way around this problem, kindly share it below.
Say something!
See more happenings in: