From 81c87b669135b886f2a6f9704e0ea5ae69c91648 Mon Sep 17 00:00:00 2001
From: Daniel Micay In order to properly implement either push messaging or frequent polling
themselves, an app needs to run a foreground service. This is displayed as a
persistent notification. It will normally be marked as a silent notification
- with the lowest possible priority, so it will be collapsed at the bottom and
- won't show up as an icon in the status bar or on the lockscreen. A battery
- optimization exception is also needed for the app to bypass device idle states
- and run while the device is idle. If you can tolerate delays while the device
- is idle, then the battery optimization exception isn't mandatory.
FairEmail and Signal are examples of apps using the proper approach of a foreground service combined with an optional battery optimization exception.