Substitute for Alarm Manager - Android

Viewed 139

Seriously, What is the solution to do a simple task like sending notifications when app is not running? (Using devices with custom OS like Xiaomi)

When alarm is set, it works for short period of times like a few minutes, but not for long periods of time like hours. (although it works perfectly fine on some devices and also when the app is running)

I have read hundreds of threads and no one has a concrete solution for this. None of the recommended methods work, I tried the following:

  1. Alarm manager + Broadcast Receiver + BackgroundService (Works on some devices, not all)
  2. Alarm manager + Broadcast Recevier + foregroundService (worked a few time but then just stopped working!) I tried intentservice, jobintent service and none worked.
  3. WorkManager (the work is delayed indefinitely, some times 15 minutes some times an hour, some times 10 hours)
  4. Added Wakelock (didin't change anything)
  5. Alarm manager + IntentService (doesn't work)
  6. Setting a process name to the service(doesn't change anything)
  7. Some thread and also Google guys say that there is no solution at the moment. However I have seen apps that managed to make it work!

I read about dontkillmyapp and I am aware of the issue. But I have one app that somehow managed to send notifications at very exact times. It is not a famous app like Whatsapp. There must be a solution.

0 Answers
Related