Examples
A runnable React Native example app that scans, connects and reads with SimpleRnBLE, with the steps to build and run it on Android and iOS phones.
The example app lives alongside the other SimpleBLE binding examples. It asks for the Bluetooth permissions, scans for five seconds, and lists what it found. Tap a peripheral to connect and list its services; each characteristic can then be read, and followed when it notifies.
The app builds SimpleRnBLE from the checkout. Prepare the binding first, from
simplernble:
cd simplernble
npm ci
npm run nitrogen
scripts/build-ios.sh # iOS only: builds SimpleBLE.xcframework into prebuilt/Then install the app's dependencies and start Metro, from examples/simplernble:
cd ../examples/simplernble
npm install
npm startWith Metro running, build and run the app on a phone in another terminal. On Android, from the repository root, which has the Gradle wrapper for React Native projects:
utils/gradle-react-native/gradlew -p examples/simplernble/android :app:installDebug
adb reverse tcp:8081 tcp:8081
adb shell am start -n org.simplernble.example/.MainActivityOn iOS, from examples/simplernble/ios:
pod install
open SimpleRnBLEExample.xcworkspacePick your phone and a development team in Xcode, then run.
For binding development and tests, see the contributor guide. For events, lifetime, and handlers, see Usage.
Usage
Install SimpleRnBLE from npm and use SimpleBLE from React Native and Expo on iOS and Android to scan, connect, use GATT and host a local peripheral.
Usage
Install SimpleFltBLE from pub.dev and use SimpleBLE in Flutter apps on Android, iOS, macOS, Windows and Linux, with the app setup each platform needs.
