-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Description
@Viras- I want Screen always wake-up in iOS, so I'm integrating power management Cordova plugin for iOS.
After Create cordova project for iOS, I added this plugin.
(cordova plugin add https://github.com/Viras-/cordova-plugin-powermanagement.git)
and put this code in my script but plugin code is not works for me.
Here is my code:
<script type="text/javascript">
document.addEventListener("deviceready", onDeviceReady, false);
//function will be called when device ready
function onDeviceReady()
{
var isDeviceiOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
if(isDeviceiOS)
{
if(window.localStorage.getItem('keepscreenonchkboxlocal') == "true")
{
isIdleTimerDisabled = true;
}
else
{
isIdleTimerDisabled = false;
}
}
else
{
if(window.localStorage.getItem('keepscreenonchkboxlocal') == "true")
{
window.powerManagement.acquire(function() {
console.log('Wakelock acquired');
}, function() {
console.log('Failed to acquire wakelock');
});
}
else
{
window.powerManagement.release(function() {
console.log('Wakelock released');
}, function() {
console.log('Failed to release wakelock');
});
}
}
}
</script>
This cordova plugin works in android but doesn't works in ios.
Thanks, Kaushik.
Metadata
Metadata
Assignees
Labels
No labels