showActionSheet 菜单栏点击拍照操作,事先检测相机权限,
if(IoA=="1"){
var AVCaptureDevice = plus.ios.importClass("AVCaptureDevice");
var Status = AVCaptureDevice.authorizationStatusForMediaType("vide");
if (3 != Status) {
mui.toast('请在设置中允许使用相机');
return false;
}
}
上面的方法不行,苹果回复
We discovered one or more bugs in your app when reviewed on iPhone running iOS 11.2.6 on Wi-Fi connected to an IPv6 network.
Specifically, your tapping on “拍照,” your app requests users to access Settings to allow camera permission; however, your app does not request access to use’s camera feature.
去点上面的方法,如果没给相册权限,能打开相机,但是无法拍照。能不能在点击拍照后检测有没有权限再打开相机,求代码
HBuilder
9.0.1.201802011934
function getImage() {
// if(IoA=="1"){
// var AVCaptureDevice = plus.ios.importClass("AVCaptureDevice");
// var Status = AVCaptureDevice.authorizationStatusForMediaType("vide");
// if (3 != Status) {
// mui.toast('请在设置中允许使用相机');
// return false;
// }
// }
var cmr = plus.camera.getCamera();
cmr.captureImage(function(p) {
plus.io.resolveLocalFileSystemURL(p, function(entry) {
if(IoA=="1")
{
fl="1";
}
else{
fl="1";
}
var path = entry.toLocalURL();
ToZip(path);
},
function(e) {
console.log(e);
});
},
function(e) {
console.log(e);
}, {
filename: "_doc/camera/",
});
}
联系方式
953966263
18709860206
0 个回复