react-native-mdm-config
v1.0.1
Published
appconfig
Readme
react-native-mdm-config
Simplest react-native library for accessing application configurations received from MDM.
- Android: using RestrictionsManager
- IOS: using react-native built-in Settings class with
com.apple.configuration.managed
The initial library code was generated using npx create-react-native-library@latest
Note
If you need more features such as on-change event, consider using https://github.com/mattermost/react-native-emm.
I've created this library because react-native-emm was conflicting with other more maintained Expo libraries such as expo-screen-capture, and to support future Expo versions more easily.
Installation
npm install react-native-mdm-configUsage
import { getManagedConfig } from 'react-native-mdm-config';
// ...
const managedVars = getManagedConfig();Testing on Android
- Use
Test DPCto create a work account. - Install the apk on that account using adb install (
adb install --user 11 android\app\build\outputs\apk\debug\app-debug.apk) - In
Test DPC, locate "Managed configurations", and add new variables under your application.
Testing on IOS
Use simctl to set variables in the IOS simulator:
xcrun simctl spawn booted defaults write APP_ID com.apple.configuration.managed -dict 'serverUrl' 'https://example.com'
Contributing
License
MIT
Made with create-react-native-library
