Plugin for Cordova (3.0+) IOS and Android
The PowerManagement plugin offers access to the devices power-management functionality. It should be used for applications which keep running for a long time without any user interaction.
#Adding the Plugin to your project
cordova plugin add https://github.com/raulduran/PowerManagement.git
#Removing the Plugin to your project
cordova plugin rm org.apache.cordova.plugins.PowerManagement
#Using the plugin
Acquire
cordova.plugins.powerManagement.acquire(onSuccess, onError);
Release
cordova.plugins.powerManagement.release(onSuccess, onError);