I don't know where to start. I am searching for this from yesterday but didn't got any idea.
I have a Cordova android app. It is working fine but if user is not doing anything then screen get locked and app will go to background/pause.
I want to keep the phone stay awake when app is running.
Is there any plugins/example for the same?
You can use this plugin in order to prevent device from falling asleep.
In order to achive that you can call this method:
window.plugins.insomnia.keepAwake()
And then, to enable it again, you have to use:
window.plugins.insomnia.allowSleepAgain()
Please look at the Github page for more details
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加