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
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.
npm install react-native-mdm-configimport { getManagedConfig } from 'react-native-mdm-config';
// ...
const managedVars = getManagedConfig();- 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.
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'
MIT
Made with create-react-native-library