react-native-mdm icon indicating copy to clipboard operation
react-native-mdm copied to clipboard

How to use this?

Open AliKarpuzoglu opened this issue 5 years ago • 5 comments

The README does not mention how this library can be used. What kind of object will data in MDMDidUpdate(data) be ? Is it a dictionary?

AliKarpuzoglu avatar Nov 09 '20 18:11 AliKarpuzoglu

@jhontech32

I wrote a bit on medium how I used MDM, maybe it helps you https://watermelonson.medium.com/how-to-add-mdm-support-for-ios-apps-in-react-native-341ad2bfacd4

AliKarpuzoglu avatar Sep 17 '22 12:09 AliKarpuzoglu

I haven’t used android for it, sorry!

AliKarpuzoglu avatar Sep 17 '22 17:09 AliKarpuzoglu

I used a wrapper around my app

<MDMConfig>
    <AppNavigator />
</MDMConfig>

and inside this wrapper, I have something like this

import MobileDeviceManager from 'react-native-mdm';

const MDMConfig = ({ children }) => {
...
  useEffect(() => {
    if (appInit) {
      mdmConfigHandler();
    }
  }, [appInit]);

  return children;
};

const mdmConfigHandler = async () => {
  try {
    const supported = await MobileDeviceManager.isSupported();
    ...
    const mdmConfig = await MobileDeviceManager.getConfiguration();
    ...
  } catch (e) {
   ...
  }
};

It works for both Android and iOS

antoniogoulao avatar Nov 17 '22 15:11 antoniogoulao

Does this work with Intune?

sonuchandra2010 avatar Oct 26 '23 15:10 sonuchandra2010