React Native SDK
Bluetooth Device
Scan

Search

Search

ℹ️

Devices discovered during the search will be updated in the addDeviceListListener

// Before searching, check for Bluetooth permissions
import { Platform } from 'react-native';
import { PERMISSIONS, requestMultiple } from 'react-native-permissions';
 
if (Platform.OS === 'android') {
  if (Platform.Version < 31) {
    await requestMultiple([PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION]);
  } else {
    await requestMultiple([
      PERMISSIONS.ANDROID.BLUETOOTH_SCAN,
      PERMISSIONS.ANDROID.BLUETOOTH_CONNECT,
    ]);
  }
}
 
const data = await RNGizSDKManagerModule.startBleScan();

Stop Search

const data = await RNGizSDKManagerModule.stopBleScan();