permission.js只提供了ios的权限检测, 没有提供调用授权的方法, 还是挺多坑的, 调用麦克风授权也是好不容易在社区找到的,
function judgeIosPermissionCamera() {
var result = false;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
console.log("authStatus:" + authStatus);
if (authStatus == 3) {
result = true;
console.log("相机权限已经开启");
} else {
console.log("相机权限没有开启");
}
plus.ios.deleteObject(AVCaptureDevice);
return result;
}
permission.js源代码只有这个方法检测权限
9***@qq.com
- 发布:2024-12-18 12:29
- 更新:2024-12-18 12:29
- 阅读:18
0 个回复