dotintent / react-native-ble-plx

React Native BLE library
Apache License 2.0
2.97k stars 498 forks source link

Support sharing JSON data between devices #1216

Open c-info opened 2 weeks ago

c-info commented 2 weeks ago

Prerequisites

Question

Is there any plan to support sharing JSON data between devices, enabling communication between phones? I want to connect two phones and share data between devices without using the internet, even if both devices are on different networks.

intent-kacper-cyranowski commented 2 weeks ago

Hi @c-info To establish basic communication between devices you should use writeCharacteristicWithResponseForDevice to write base64 data to the characteristics and readCharacteristicForDevice to read data as base64 from device. You can read more in introduction section of the documentation. After data read you will receive base64 which (in your case) you will have to convert to string, and later on parse as the JSON.

Let me know if this answers your question.