微信版本更新7.09后,小程序蓝牙接口wx.getBluetoothAdapterState出问题?
发布于 5 年前 作者 ping67 11045 次浏览 来自 问答

iphoneXiphone7p都是如此,iphone之前都是正常的,安卓没有这个问题,7.0.9后蓝牙确认是打开的,wx.getBluetoothAdapterState走的也是sucess,但是

available却是false。

代码片段

wx.getBluetoothAdapterState({
  success: function (res) {
    ischeckBlueTimeOut = true;
    clearTimeoutcheckBlueTimeOutCallBack
    if (res.available) {
      // 蓝牙状态正常
      typeof success == "function" && success(res)
    } else 
      console.error('蓝牙未开启');
      console.error(JSON.stringify(res));
      ....
      typeof fail == "function" && fail(res);
    
  }, fail: function (res) {
    console.error('蓝牙不正常 ' + JSON.stringify(res));
    ....
    typeof fail == "function" && fail(res);
  }
})
1 回复

你好,麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点

回到顶部