STOP waking screen for local notifications (Android)

hi folks, i’m showing local notifications on android regularly (like every 10-20 minutes) on the lowest priority (-2 for <8.0, which means notifications don’t show on lock screen, they don’t show in the status bar, and are only visible at the bottom of the notification shade when you swipe it down).

but whenever there’s a new notification, the whole screen turns on for a few seconds. no notification shows, which is great, but the screen turning on drains battery life for no reason.

is there any way to stop this from happening? seems like wakeup is an ios-only option…is there a work-around any one here knows about?

i worked around the issue by changing the default value of wakeup to false in www/local-notification-util.js…removed & re-added the android platform and it works now.

1 Like

good job, can you tell me if it’s possible to shedule functions with local notifications? Maybe even without any notification, just the function call every few minutes. I think it should but I didn’t try it yet but i’m planning to do so soon.

have you considered just using settimeout() or setinterval()?

even if you use a hook like on(trigger) with localnotifications, you’ll still probably need to run the app in background mode for the function to actually execute (and, of course, you’ll get a notification it sounds like you don’t want).

with settimeout() you won’t get the notification.

i’ve been testing this method for the past 2 days on 4 different phones with android 5, 6, and 7 and battery usage is about the same as the localnotifications method.

Well that’s one of the main Tasks to wake up the phone and I don’t think that the other two functions will fulfill this. I’m looking for Options to do this and I thought notifications could wake up the phone.

notifications can wake the screen but they won’t wake the phone to run functions. for that you’ll need backgroundmode…at least that’s my experience.