Skip to content

Bare React Native

Bare React Native apps (no Expo prebuild) declare the Bluetooth permission config by hand. The two blocks below mirror exactly what the Expo config plugin writes, so both paths produce identical native projects.

The SDK supports bare React Native 0.79+ on the New Architecture.

Add the Bluetooth usage description (iOS shows it in the permission prompt):

ios/YourApp/Info.plist
<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app uses Bluetooth to find and connect to your Rogue consoles.</string>

Do not add the deprecated NSBluetoothPeripheralUsageDescription, and do not add UIBackgroundModes unless you specifically opt in to background BLE.

Declare the Android 12+ permission pair, plus the legacy trio capped at API 30 for Android 11 and below:

android/app/src/main/AndroidManifest.xml
<!-- Android 12+ (API 31+) -->
<uses-permission
android:name="android.permission.BLUETOOTH_SCAN"
android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<!-- Android 11 and below -->
<uses-permission
android:name="android.permission.BLUETOOTH"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN"
android:maxSdkVersion="30" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"
android:maxSdkVersion="30" />

neverForLocation declares that scan results are never used to derive location, which removes the location-permission requirement for scanning on Android 12+. Runtime permission prompts are driven in-app through the useBlePermissions() hook — no PermissionsAndroid code needed.

@rogue/console-sdk itself is pure TypeScript — it contains no native code. Its peer react-native-ble-plx does, and React Native autolinks it; no settings.gradle or Xcode project edits are required.

On iOS, install pods after adding the dependency:

Terminal window
npx pod-install
# or: cd ios && bundle exec pod install

Then rebuild the app (npx react-native run-ios --device / run-android) — permission and native-module changes never hot-reload.