wx.onSearchBeacons 监听不到蓝牙设备?
//开启扫描beacon功能
setTimeout(function () {
wx.startSearchBeacons({
ticket: “”,
complete: function (res) {
if (res.errMsg.indexOf(‘bluetooth power off’) > -1) { alert(“请打开蓝牙”); }
else {
//监控扫描beacon
wx.onSearchBeacons({ complete: function (argv) { alert(JSON.stringify(argv)); } });
}
//继续扫描
$extend.startSearchBeacons();
}
});
}, 2000);
