|
const resultList = api.hasPermission({
list: [
'camera',
'photos',
'storage',
'location',
'ble-scan',
'ble-ad',
'ble-connect',
'microphone'
]
});
const permission = [];
resultList.map((item) => {
if (!item.granted) {
permission.push(item.name);
}
return '';
});
if (permission.length > 0) {
if (api.systemType === 'ios') {
api.confirm(
{
title: '温馨提示',
msg: '检测到权限未授权,必须授权(相机、相册、存储、手机号码)',
buttons: ['确定']
},
() => {
api.requestPermission({
list: permission
});
}
);
} else {
api.requestPermission({
list: permission
});
}
}
Android13 需要什么权限 |
|