I am newbie in react native based app development. We have to develop a mobile app (as BLE client) that needs to communicate through BLE (Bluetooth low energy / smart Bluetooth) to monitor an IOT device (a BLE peripheral/central). We are using Bluetooth Developer studio tool from Bluetooth SIG to design custom BLE services and generate the BLE profile for our IOT device. For the mobile side, we are going to use facebook's react native cross platform framework.
Can anybody recommend some good BLE libraries for react native apps ?
React Native BLE PLX is one of the 2 libraries you can use to work with this technology.
Simulator does not support Bluetooth. Expo Go does not support Bluetooth.
However, you can still use the old version of the library even up to 0.60.5 RN version, but with additional changes. As for OS versions, the library works on iOS 9+ and Android API 19+. This library is an alternative option you can use to integrate a BLE device into a React Native application.
In order to do this we’ll use the Bluetooth library react-native-ble-plx, which, at the time of writing, is the most popular in React-Native. First install the library into your project by running this command at the root of your project: Next we’ll need to follow some iOS and Android Specific instructions
react-native-ble-manager : A great module/library for low level BLE communication via service and characteristic UUIDs (i.e BLE commands as hex values ) It's easy to use, widely used by community and well matured library but requires BLE service and characteristic UUIDs knowledge.
Bluetooth Low Energy is also known as BLE. This is a version of Bluetooth that is adapted to low power sensors and accessories. Such devices don’t require continuous connection but depend on long battery life. They are especially popular in the fitness, healthcare, security, home entertainment industries, and beacons.
As i couldn't find any good answer at one place so i tried few libraries by myself. I just share my conclusion which may be helpful to other newbies for starting react native based BLE client mobile app.
So, Here are some good BLE libraries for Client(Central) role that can be used in React Native Mobile Apps :-
react-native-ble-manager : A great module/library for low level BLE communication via service and characteristic UUIDs (i.e BLE commands as hex values ) It's easy to use, widely used by community and well matured library but requires BLE service and characteristic UUIDs knowledge.
react-native-ble-plx Developers who love ReactiveX programming may refer to this Low level BLE communication module via service and characteristic UUIDs (i.e BLE commands as hex values ) It's a very stable library, actively maintained, asynchronous in nature but requires lots of memory and comparatively slow performance due to multiple dependent libraries and usage of base64 encoding/decoding for data conversion.
react-native-ble-quick-sdk Developers who love Bluetooth Developer Studio and who wants to build app quickly without much BLE knowledge may refer to this high level BLE API module which doesn't require knowledge of service and characteristic UUIDs (i.e BLE commands as hex values ) It requires comparatively less memory and gives better performance as it is not using base64 for data conversion. Partially reactive in nature as it use Node's EventEmitter. It auto generates lots of API source for target BLE device and also auto generates device specific sample app. The biggest drawback is that there's no stable version and not widely used yet.
react-native-ble : A NodeJS style low level BLE communication module via service and characteristic UUIDs (i.e BLE commands as hex values ) Not so actively maintained but it's based on a very stable noble library.
In react native the best library which i have used is below. You can test it. Whether your all requirements are full-filed or not. Even there will be some situations where you will need to manipulate Android Default Bluetooth functionality.
https://github.com/Polidea/react-native-ble-plx
The best way to resolve your problem is try to understand Bluetooth functionality of Android and IOS and how you can manipulate nicely to work with above library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With