Cordova Plugin Kiosk Mode
Installation
$ cordova plugin add https://github.com/amicaldo/cordova-plugin-kiosk-mode$ npm i https://github.com/amicaldo/cordova-plugin-kiosk-mode
Permissions
In order to properly use this plugin, your give your app the android.permission.WRITE_SECURE_SETTINGS
permission:
$ adb shell pm grant <package> android.permission.WRITE_SECURE_SETTINGS
This is needed to update the Settings.Global.DEVICE_PROVISIONED
setting.
Another approach is to install your application with the -g
flag:
$ adb install -g <apk>
This will grant your application all permissions listed in the app manifest.
Enable Kiosk Mode
-
Manually set your application as launcher in your android settings*
-
Run
KioskMode.enable()
in your application
Disable Kiosk Mode
- Run
KioskMode.disable()
in your application - Run
KioskMode.switchLauncher()
and select your default launcher*
* Only if you set up your application as launcher.
Usage
/** * @return */KioskMode.enable; /** * @return */KioskMode.disable; /** * @return */KioskMode.isEnabled; /** * @return */KioskMode.isLauncher; /** * @return */KioskMode.switchLauncher;
Notes
Use this plugin with caution. Users may not get out of the Kiosk Mode by theirselves.
Installing apps with this plugin may automatically trigger – depending on the android version and device – a chooser to select a launcher.
Author
Jannik Hauptvogel hauptvogel@amicaldo.de
Contact
Support support@amicaldo.de