BrainBit for developers Subscribe for updates Visit website

ReactNative

Samples - GitLab

The latest version is `1.0.20`.

ReactNative standalone page: Link

Available for iOS and Android platforms

By npm:

    
$ npm install react-native-neurosdk2 --save
    

 

Since the SDK uses the Bluetooth API, you need to configure the project.

 

For Android you need to request runtime permission:

    
#TypeScript

export async function requestPermissionAndroid() {
try {
const granted = await PermissionsAndroid.requestMultiple([
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
]);
if (
granted[PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION] ===
PermissionsAndroid.RESULTS.GRANTED
) {
...
}
if (
granted[PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT] ===
PermissionsAndroid.RESULTS.GRANTED
) {
...
}
} catch (err) { }
}
    

 

For iOS you need to add a key to `Info.plist` because it uses Bluetooth too:

    
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Explanation to using bluetooth</string>