cordova-keyguard-plugin
v0.2.1
Published
Cordova keyguard plugin
Downloads
5
Maintainers
Readme
KeyGuardPlugin
Cordova keyguard plugin
Installation
If using cordova-cli
5.0 or newer:
cordova plugin add cordova-keyguard-plugin
for older versions:
cordova plugin add https://github.com/vstirbu/cordova-keyguard-plugin.git
JavaScript API
The plugin exposes the keyguard state for the application as navigator.keyguard
object.
Reading the keyguard state
navigator.keyguard;
Changing the keyguard state
To activate the keyguard use the following:
navigator.keyguard = true;
To deactivate the keyguard use the following:
navigator.keyguard = false;
keyguard
event
The plugin emits keyguard
events whenever the state change has completed. You can reister for this events:
window.addEventListener('keyguard', function (state) {
// state can be true or false;
});
Suported platforms
- Android
License
The plugin is available under MIT license.