收藏
回答

小程序检索蓝牙设备,华为p20手机进不去wx.onBluetoothDeviceFound()?

wx.onBluetoothDeviceFound((res) => {

                                console.log('获取蓝牙设备')

                                console.log(res)

                                //将我们的ibeacon设备找到并放进数组

                                for (var i = 0; i < res.devices.length; i++) {

                                  var content = {

                                    address: res.devices[i].name,

                                    strength: res.devices[i].RSSI

                                  };

                                  that.data.resultList.unshift(content);

                                  that.setData({

                                    resultList: that.data.resultList

                                  })

                                }

                              })

这是蓝牙检索代码,p20手机直接跳过,没有进入这个代码块

回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签