Search code examples
androidpush-notificationnotificationsandroid-notificationsandroid-workmanager

Is there any way to create reliable recurring notificatons on every Android device?


What I want to create: An offline app that sends a text notification to user from the database (Room) once every 5 days at a random time. I test the app on my real device Redmi Note 7 (MIUI).

So I tried to use Alarm Manager and Work Manager for repeating task but it only worked right (even app is killed) if I enabled autorun and disabled buttery optimization for my application. Then I found out that many manufacturers like Xiaomi, Oppo, Huawei and similar restrict background work for apps.

I have 2 questions:

  1. What should I use to write reliable recurring notifications (not with foreground service) on every android device without requesting users to enable autorun and similar app settings?
  2. How apps like Twitter and Telegram sends notifications without enabling extra settings, although they use the internet unlike my app

Solution

  • So, I found out that there is no way to send reliable recurring notifications offline via Alarm Manager or Work Manager on every android device. I use FCM and everything works great