React Native Wrappers for MCUMgr's Android / iOS client libraries
npm install @playerdata/react-native-mcu-managerReact Native Wrappers for MCUMgr's Android / iOS client libraries
- Documentation for the main branch
- Documentation for the latest stable release
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.
For bare React Native projects, you must ensure that you have installed and configured the expo package before continuing.
```
npm install @playerdata/react-native-mcu-manager
Run npx pod-install after installing the npm package.
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.
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, add BLUETOOTH_SCAN.BLUETOOTH
- API 30 and below: , BLUETOOTH_ADMIN, ACCESS_FINE_LOCATION (use maxSdkVersion="30").ACCESS_COARSE_LOCATION
- API 23 and below: also (use maxSdkVersion="23").
What you should do:
1. Manifest: Declare the above permissions in your app’s AndroidManifest.xml. The library will not add any.BLUETOOTH_CONNECT
2. Runtime: Request the relevant permissions at runtime before using this module (e.g. before connecting, BLUETOOTH_SCAN before scanning, ACCESS_FINE_LOCATION on older Android; ACCESS_COARSE_LOCATION on API 23 and below if needed for BLE).@RequiresPermission(BLUETOOTH_CONNECT)
3. IDE: The module uses 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 editing AndroidManifest.xml directly, for example:
`json``
{
"expo": {
"android": {
"permissions": [
"ACCESS_FINE_LOCATION",
"ACCESS_COARSE_LOCATION",
"BLUETOOTH_SCAN",
"BLUETOOTH_CONNECT"
]
},
"ios": {
"infoPlist": {
"NSBluetoothAlwaysUsageDescription": "Requires Bluetooth to perform firmware updates."
}
}
}
}
Contributions are very welcome! Please refer to guidelines described in the contributing guide.