[Android] Notification doesn't show when phone is in Doze / deep sleep (probably)
See original GitHub issueScheduled notifications do not show consistently - they only trigger sometimes. I believe that they do not trigger if the phone is in Doze mode / deep sleep, neither do they show up after the phone wakes from Doze / deep sleep.
Your Environment
- Plugin version: 0.8.5
- Platform: android (ios not yet tested)
- OS version: 6 & 7
- Device manufacturer / model: Samsung Galaxy S5 & S7
- Cordova version (
cordova -v
): 7.0.1
Installed platforms: android 6.1.2 browser 4.1.0 (for some previous tests, will be removed) ios 4.3.1 Available platforms: blackberry10 ~3.8.0 (deprecated) webos ~3.7.0 windows ~5.0.0
- Plugin config: ?
- Ionic Version (if using Ionic): N/A - Angular 1.6
Expected Behavior
Notification should show either at 5 AM every morning or at least after the phone wakes up from Doze.
Actual Behavior
Notification rarely triggers. However, if scheduled midday or every minute, the notification shows up properly.
Steps to Reproduce
Schedule a notification at a time when you are sure the phone is in Doze mode / deep sleep.
Context
We were trying to schedule a daily notification that the user finds after waking up - i.e. remember to fill-in your journal for yesterday.
I believe that the problem is not related to our code or the Angular framework, since the notification properly triggers and shows up if scheduled at a different time, when the phone is not sleeping.
As a workaround, we could probably schedule the notification every minute beginning at 5 AM and, when it is actually triggered, cancel it, then re-schedule it with every minute beginning the next day at 5 AM. This seems like a dirty solution, though. Any help is appreciated!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
If the notification is very important, then set the priority to 2 using 0.9-beta (master branch)
Just FYI for future readers, the fix looks to be in commits: d85f6af16b41b29d3501b3bfb1c5729a2a795222 & d9bb523c6d5e7dca851adf93d873254e1854f317