wx.onBeaconUpdate 安卓手机经常不执行,10次只有3次成功,苹果手机可能有7次?
发布于 6 年前 作者 xiulan42 250 次浏览 来自 问答

问题:几十个ibeacon设备在身边,经常搜索不到,用多个ibeacon app搜索工具都能搜索到,用微信小程序接口就是经常搜索不到,而且在搜索到的情况下永远只能同时搜索到其中一个设备,其实我传入的是一个uuids数组;

api:wx.onBeaconUpdate

微信版本:安卓最新版本 v7.0.17

手机:华为mate30 pro

微信号:china_hujunjie

测试时间:2020-07-31 14:00:00 ~2020-07-31 14:02:30

2 回复

部分代码:


wx.startBeaconDiscovery({

      //fda50693-a4e2-4fb1-afcf-c6eb07647825,fda50693-a4e2-4fb1-afcf-c6eb07647825,12345678-9012-3456-7890-123456789012

      uuids:['fda50693-a4e2-4fb1-afcf-c6eb07647002','fda50693-a4e2-4fb1-afcf-c6eb07647003','fda50693-a4e2-4fb1-afcf-c6eb07647004','fda50693-a4e2-4fb1-afcf-c6eb07647005'],

      success: function (res) {

        console.log("开始扫描设备...",res);

     

        // 监听iBeacon信号  

        wx.onBeaconUpdate(function (res) {

          console.log("开始监听~");

          if (res && res.beacons && res.beacons.length > 0{

            // 此处最好检测rssi是否等于0,等于0的话信号强度等信息不准确。我是5秒内重复扫描排重。  

            console.log("当前监听到:",res.beacons);

           //this.devices = res.beacons;

回到顶部