question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Notification doesn't show when phone is in Doze / deep sleep (probably)

See original GitHub issue

Scheduled 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:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
katzercommented, Oct 30, 2017

If the notification is very important, then set the priority to 2 using 0.9-beta (master branch)

0reactions
jaimeyucommented, Oct 30, 2017

Just FYI for future readers, the fix looks to be in commits: d85f6af16b41b29d3501b3bfb1c5729a2a795222 & d9bb523c6d5e7dca851adf93d873254e1854f317

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications only appear when unlocked. Deep Sleep cuts ...
Solved: I have done a fair bit of research by now, and it seems googles Android is partly to blame for removing a...
Read more >
Android Notifications Not Showing Up? 10 Fixes You Can Try
Not seeing notifications show up on your Android phone? Try these fixes to get Android notifications working again.
Read more >
Push notifications not working while screen is off
Sometimes push notifications work, sometimes they are delayed ... that the phone somehow goes to a deep sleep mode and puts the notification...
Read more >
Android Notification not fired when phone sleeps for a long time
So my problem is when the phone goes to sleep for a long time, the notifications are not processed until I manually pressed...
Read more >
Apps in deep sleep or doze and i'm not receiving any push ...
Put unused app to sleep is off. no sleeping apps, no deep sleeping apps. Dev ops -> don't keep activities is off. Dev...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found