wx.getSetting({
success: (res) => {
if (!res.authSetting['scope.bluetooth']) {
wx.authorize({
scope: 'scope.bluetooth',
success: (res) => {
// 用户已授权,可以调用蓝牙API
this.openBluetoothAdapter();
},
fail: (res) => {
// 用户拒绝授权蓝牙权限
if(res.confirm){
uni.openSetting({
success: (res) => {
if(res.authSetting['scope.bluetooth']){
console.log("OK");
}else{
console.log("no");
}
}
})
}
}
});
} else {
this.openBluetoothAdapter();
}
}
});
第二天早上他又能调用起来,但改代码提交版本后就再也调不起授权了。
打开调试看看报错什么