这里以uni.onBluetoothDeviceFound为例
包括(微信小程序、支付宝小程序)也是同理
onBluetoothDeviceFound() {
console.log("发现外围设备")
uni.onBluetoothDeviceFound((res) => {
console.log(res)
console.log(JSON.stringify(res.devices))
})
},
确保代码没bug的情况下,
一般搜索需要等待几秒才会出结果,如果没出来,那就是部分机型需要开启GPS定位功能才能搜索到