微信公众号通过jsapi调用蓝牙初始化失败?
发布于 5 年前 作者 shaoyong 12981 次浏览 来自 官方Issues

目前测试部分手机正常,包括iphone11 pro max(系统官方最新)、iphone11、iphone se2和部分android机型,但目前发现以下机型无法初始化,

iphone8 plus(系统官方最新)、华为mate40(出厂版本)、小米K30(出厂版本)

苹果手机报错如下:

openWXDevicceLib:{"err_msg“:“openWXDevicceLi:fail_no permission to execute”}

安卓手机报错如下:

openWXDDeeviceLib:{“err_msg”:“system:access_denied”}

微信版本截止目前为最新版本且通过认证

AppID:wx8ac1c985af8b670a

日志已上传,2021-03-19 10:07分测试并上传

jsapi各种版本(从1.0.0至1.6.0)匀有测试,问题一致。

https://res2.wx.qq.com/open/js/jweixin-1.0.0.js

初始化代码:

wx.invoke('openWXDeviceLib', {'brandUserName':'gh_xxxxxxxxx'}, function(res){
    //console.log('openWXDeviceLib:'+res);
    alert('openWXDeviceLib:'+JSON.stringify(res));
    if(res.err_msg.toUpperCase()=='openWXDeviceLib:ok'.toUpperCase()) {
        switch (res.bluetoothState) {
            case 'off':
                alert('请打开手机蓝牙.');
                break;
            case 'unauthorized':
                alert('请授权微信蓝牙功能并打开蓝牙.');
                break;
            case 'on':
                vm.bluetoothstate(true);
                break;
            default:
                alert('未知错误');
        }
    } else {
        alert('初始化蓝牙错误.');
    }
});
回到顶部