Search code examples
react-nativebluetoothbluetooth-lowenergyreact-native-ble-plxreact-native-ble-manager

How to send data between two phones with Bluetooth and React Native?


I've recently read many articles about broadcasting data between devices with Bluetooth and I'm now trying to create an app working like Airdrop, on which you would be able to see which user is using the app and then send data via Bluetooth. So far I've been trying to use react-native-bluetooth-manager and react-native-bluetooth-plx, but I read in the docs that:

It does NOT support:

- bluetooth classic devices.
- communicating between phones using BLE (Peripheral support)
- bonding peripherals

I've read other articles on this on StackOverflow that where published one year ago and that didn't really have a solution.

Does anyone know if it's now possible to send data between phones with BLE ?


Solution

  • Yes it's definitely possible and there are a few examples that already do this. That being said, file transfer is one of the more complex applications of BLE especially if you want to implement this over both Android and iOS. The reason is that you'll need to use the GATT specification and implement the file transfer protocol yourself as one doesn't exist natively for BLE. Please see links below for more information:-