@playerdata/react-native-mcu-manager
v4.5.2
Published
React Native Wrappers for MCUMgr's Android / iOS client libraries
Readme
@playerdata/react-native-mcu-manager
React Native Wrappers for MCUMgr's Android / iOS client libraries
API documentation
Installation in managed Expo projects
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
Installation in bare React Native projects
For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.
Add the package to your npm dependencies
npm install @playerdata/react-native-mcu-managerConfigure for iOS
Run npx pod-install after installing the npm package.
Configure for Android
Manifest & permissions: This library does not declare any permissions in its own Android manifest. You must declare and request all required Bluetooth (and, where applicable, location) permissions in your app’s manifest and at runtime.
See Android permissions below for the exact permissions and runtime handling.
Android permissions
This library does not declare any permissions in its Android manifest. Your app must declare and handle all permissions itself.
Required permissions:
- Android 12+ (API 31+):
BLUETOOTH_CONNECT(for BLE connect). If you also scan for devices, addBLUETOOTH_SCAN. - API 30 and below:
BLUETOOTH,BLUETOOTH_ADMIN,ACCESS_FINE_LOCATION(usemaxSdkVersion="30"). - API 23 and below: also
ACCESS_COARSE_LOCATION(usemaxSdkVersion="23").
What you should do:
- Manifest: Declare the above permissions in your app’s
AndroidManifest.xml. The library will not add any. - Runtime: Request the relevant permissions at runtime before using this module (e.g.
BLUETOOTH_CONNECTbefore connecting,BLUETOOTH_SCANbefore scanning,ACCESS_FINE_LOCATIONon older Android;ACCESS_COARSE_LOCATIONon API 23 and below if needed for BLE). - IDE: The module uses
@RequiresPermission(BLUETOOTH_CONNECT)for IDE guidance. Location and legacy Bluetooth permissions (see above) are documented in KDoc; ensure your app satisfies them where the API is used.
If you are using Expo (managed or prebuild):
Configure the same Android permissions via your Expo config (
app.json/app.config.*) instead of editingAndroidManifest.xmldirectly, for example:{ "expo": { "android": { "permissions": [ "ACCESS_FINE_LOCATION", "ACCESS_COARSE_LOCATION", "BLUETOOTH_SCAN", "BLUETOOTH_CONNECT" ] }, "ios": { "infoPlist": { "NSBluetoothAlwaysUsageDescription": "Requires Bluetooth to perform firmware updates." } } } }
Contributing
Contributions are very welcome! Please refer to guidelines described in the contributing guide.
