Closed mirzabros closed 8 years ago
document.addEventListener("deviceready",function() {
window.plugins.insomnia.keepAwake();
});
Hi, I try the same: enable keepAwake on the app start. Can you pls have a quick look into it if its a problem on my side or the plugin:
The app build can be found here: https://build.phonegap.com/apps/1944299/share
I tested it with the Samsung Galaxy A3 (2016) with Android 5.1.1.
@dragonprojects you're not including a reference to cordova.js
in index.html
. And you may want to consider using the plugin from npm instead of the old one on pgb: <plugin name="cordova-plugin-insomnia" source="npm" />
Thx, will try it.
little bit off topic: you know a good way to add the script tags into the index.html for some build specific javascripts (cordova.js and in my case the scorecard-phonegap.js) during the phonegap build? So the normal webpage doesn't need to link them.
Google my friend, Google. And if that fails: StackOverflow.
Hi there.
I have a switch ON OFF to keep screen awake. This is working file but I want to enable keepAwake from the time it starts the app.
Please help me out with this.
I am happy to pay for time.
Thanks