
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
kiosk-react-native
Advanced tools
A Library for setting up kiosk mode on Android with react native
npm install kiosk-react-native
import { enableKioskMode, disableKioskMode } from 'kiosk-react-native';
// Enable Kiosk Mode
enableKioskMode();
// Disable Kiosk Mode
disableKioskMode();
We need device owner permission for the app for higher order access like disable volume buttons,prevent uninstallation etc.
Add below configuration to AndroidManifest.xml(android/app/src/main/AndroidManifest.xml)
Add android:testOnly . This will allow to developers to uninstall and remove admin for the app.
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:supportsRtl="true"
android:testOnly="true"
...Rest of the App
Now create a new "device_owner.xml" file (android/app/src/main/xml/device_owner.xml) and add the following code.
<?xml version="1.0" encoding="utf-8"?>
<device-admin>
<uses-policies>
<limit-password/>
<watch-login/>
<reset-password/>
<force-lock/>
<wipe-data/>
<expire-password/>
<encrypted-storage/>
<disable-camera/>
</uses-policies>
</device-admin>
Add a new reciever to your AndroidManifest.xml(android/app/src/main/AndroidManifest.xml).
<receiver
android:name="com.kiosk.RNKioskDevice"
android:label="@string/app_name"
android:exported="true"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_owner" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
</intent-filter>
</receiver>
Finally run the following script using adb
adb shell dpm set-device-owner <YourPackageName>/com.kiosk.RNKioskDevice
Rebuild the app. The app should run in admin mode now.
To Remove the device from owner
adb shell dpm remove-active-admin <YourPackageName>/com.kiosk.RNKioskDevice
MIT
Made with create-react-native-library
FAQs
A Library for setting up kiosk mode with react native
The npm package kiosk-react-native receives a total of 340 weekly downloads. As such, kiosk-react-native popularity was classified as not popular.
We found that kiosk-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.