onBluetoothDeviceFound获取蓝牙设备为什么没有任何反应?

这里以uni.onBluetoothDeviceFound为例
包括(微信小程序、支付宝小程序)也是同理

onBluetoothDeviceFound() {
    
    
	console.log("发现外围设备")
	uni.onBluetoothDeviceFound((res) => {
    
    
		console.log(res)
		console.log(JSON.stringify(res.devices))
	})
},

确保代码没bug的情况下,
一般搜索需要等待几秒才会出结果,如果没出来,那就是部分机型需要开启GPS定位功能才能搜索到

猜你喜欢

转载自blog.csdn.net/qq_42783654/article/details/115260610