(Android) Ionic local notifications are not delivered on time

I’ve noticed this too. If my Android phone hasn’t been active for a bit (probably in Doze), local notifications are not fired at the exact time they were scheduled.

Reading through Schedule alarms  |  Background work  |  Android Developers, it seems this is expected when using SCHEDULE_EXACT_ALARM and setExactAndAllowWhileIdle (allowWhileIdle).

It sounds like to always get exact alarms/notifications, you need to use USE_EXACT_ALARM; however, this has restrictions by Android so it depends on your use case and whether or not it fits under Android’s guidelines.

These notes for the release of Android 14 also gives a good summary - Schedule exact alarms are denied by default  |  Android Developers.