cordova-keyguard-plugin

0.2.1 • Public • Published

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.

Package Sidebar

Install

npm i cordova-keyguard-plugin

Weekly Downloads

3

Version

0.2.1

License

MIT

Last publish

Collaborators

  • vstirbu