I’m trying to figure out how to do that with Expo.
I have a variable (obtained from a rest/api call) that helps me understand when to keep the screen of my android device on and when to turn it off.
so I thought I’d use this library :
My code is very basic ( res.screen can only have two values… and every 30 seconds I call this REST/API to read them… the values are on|off)
But when the device Android goes into sleep modality… the activateKeepAwake() call does not turn the tablet on screen.
Do you have any suggestions to give me?The purpose is really simple:
Think of an android device attached to a wall… I’d like to keep the screen on during daylight hours only and turn it off at night… and then turn it back on and so on…
Analyzing even better: I discover that when the device goes into standby/sleep after X seconds … my code that runs every 30 seconds in my app, that read of REST/API reading stops working… so this is part of the problem too that sleeping shutdown all
If you have any suggestions I would be grateful
or is there a way or bee to turn off the screen and not send the application to stand.by?