react-native-mdm

2.0.1 • Public • Published

Install react-native-mdm

npm install react-native-mdm

Setup

import MobileDeviceManager from 'react-native-mdm';
MobileDeviceManager
  .isSupported()
  .then(supported => console.log(supported))
  .catch(error => console.log(error));
MobileDeviceManager
  .getConfiguration()
  .then(result => console.log(result))
  .catch(error => console.log(error));
componentDidMount() {
  this.MDMListener = MobileDeviceManager.addListener(this.MDMDidUpdate);
}
 
MDMDidUpdate(data) {
  console.log('AppConfig data was changed');
  console.log(data);
}
 
componentWillUnmount() {
    this.MDMListener.remove();
}

Additional steps for Android

Schema and extra settings needed for AndroidManifest.xml to obtain app configurations from MDM provider. Android documentation regarding this

<meta-data android:name="android.content.APP_RESTRICTIONS"
  android:resource="@xml/app_restrictions" />
<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
 
  <restriction
    android:key="downloadOnCellular"
    android:title="@string/download_on_cell_title"
    android:restrictionType="bool"
    android:description="@string/download_on_cell_description"
    android:defaultValue="true" />
 
</restrictions>

Readme

Keywords

Package Sidebar

Install

npm i react-native-mdm

Weekly Downloads

759

Version

2.0.1

License

MIT

Unpacked Size

118 kB

Total Files

24

Last publish

Collaborators

  • atticoos
  • christopherrobin