I have a small android application project (Used for a local community news app)on android, which is (or was) working on API 22 and onward. Only a issue recently came to our notice is that on Chinese phones like Xiaomi or Oppo or Vivo our notifications (tried both local/Firebase) are not working even when the application is white-listed.
I see some suggestions on online blogs to use AlarmManager (but I guess this is bad idea - for real time notifications), not sure
I have also tried trading on code like below, but still no luck
https://github.com/commonsguy/cw-omnibus/tree/v8.4/Notifications/Foreground
What I've figured out is, if the app task is locked, it will be persisted and my app notification work.
See the image below:
How to programmatically achieve this?
Can it be a single code (or module) for all the versions of Xiaomi or Oppo or Vivo (or say MiUI)?