Examples
A runnable React Native app that scans, connects, and reads with SimpleRnBLE.
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.
