What to Consider when Integrating BLE in your React Native App

Published: May 2, 2022

9 min read

You can read a bit more on GATT, Profiles, Services and Characteristics here, and on Notifications & Indications — here.

Nevertheless, let’s get back to today's main topic!

⚙️ 2 Main Libraries for BLE Integration in React Native

As of July 2020, there are 2 libraries that can be used for Bluetooth Low Energy React Native integration:

  • react-native-ble-plx
  • react-native-ble-manager

❗️ Important note: this article is based on v.7.3.0 of react-native-ble-manager and v.2.0 of react-native-ble-plx

Let’s take a closer look!

🛠 react-native-ble-plx

GitHub | Documentation | Wiki

React Native BLE PLX is one of the 2 libraries you can use to work with this technology. It supports all the key features:

  • observing the adapter state of the device’s Bluetooth, which is crucial for enabling functionalities like a scan button;
  • connecting to discovered peripherals;
  • scanning for nearby BLE devices;
  • discovering services;
  • discovering, reading and writing characteristics;
  • observing indications & notifications;
  • negotiating MTU;
  • reading RSSI;
  • working in background mode on iOS;
  • turning on the Bluetooth adapter of the device.

Yet, the library doesn’t support the following features:

  • peripheral support that enables the communication between phones through BLE;
  • creating bonds with peripheral devices;
  • working with Bluetooth Classic devices.

The new (2.x) version of the library supports all the latest RN versions starting from 0.60. 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+.

⚒ react-native-ble-manager

GitHub

This library offers an alternative for integrating BLE in React Native applications.

Despite the absence of an explicit features list, we have identified the key BLE functionality based on method names. It includes all the features react-native-ble-plx has and a few additional ones such as:

  • bonding peripherals;
  • requesting connection priority;
  • getting connected & bonding peripherals.

The latest version of the BLE manager React Native library supports RN 0.60 and newer. However, the older version of the library can be used with older RN versions:

  • React Native 0.40-0.59 is supported until 6.7.X
  • React Native 0.30-0.39 is supported until 2.4.3

As for OS versions, this library covers iOS 8+ and Android API 18+.

You can find even more smaller details on react-native-ble-plx here, and on react-native-ble-manager here.

✅ Apps to Test BLE Devices

When developing a mobile appication with BLE integration using a React Native BLE library, it's crucial to test how it will function with such devices.Our team used the following apps:

These tools are quite similar and provide many options to test different features of Bluetooth Low Energy devices.

💡 Takeaways: So, Which One to Choose?

Simple but true: the best choice, as illustrated in our react native BLE examples, is always the one that matches your needs better than all the other options. Thus, we'd recommend you to consider things like:

  • the required features;
  • the RN version used in the project;
  • the OS versions you’d like to cover.

Got questions about integrating React Native BLE? We'll help clarify everything for you! Send us a message and we'll solve your problem.

Get in touch!

Read also

How can we help you?

Our clients say

Stormotion client Pietro Saccomani, Founder from [object Object]

They make the whole business work for us, and their improvements are fundamental to our operations. They’re reliable, honest, and willing to try new things that will help us. We appreciate how flexible and easygoing they are.

Pietro Saccomani, Founder

MobiLoud