搜索
搜索
ℹ️
搜索发现的设备,将会在 addDeviceListListener 监听中更新
// 搜索前,请检查是否有蓝牙权限
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();
停止搜索
const data = await RNGizSDKManagerModule.stopBleScan();