【发布时间】:2018-05-11 21:02:39
【问题描述】:
我正在使用ionic、Xcode 和cordova-plugin-camera 访问我的iphone 库。它在 IOS 11.1.2 上运行。
我想所有授权都已设置,但是当我从我的图像选择器库中单击图片时(图像选择器正在显示),我收到了这个错误:
发现扩展时遇到[discovery] 错误:Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
关注这个话题: PhotoPicker discovery error: Error Domain=PlugInKit Code=13 看来这可能是缺少权限错误。
如下所示,Info.plist 已设置,我找不到错误在哪里,有什么想法吗?
// FUNCTION TO OPEN MY IPHONE'S LIBRARY AND SELECT A PIC
$scope.takePic = function()
{
navigator.camera.getPicture(
function(uri){
//console.log(uri);
},
function(){
$ionicPopup.alert({
title: 'Error',
template: 'Impossible'
});
},
{
destinationType: 1,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
allowEdit: false,
saveToPhotoAlbum: false,
quality: 30,
}
);
};
<!--LINES ADDING IN MY CONFIG.XML TO SET THE INFO.PLIST FILE -->
<edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
<string>need camera access to take pictures</string>
</edit-config>
<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to get pictures from there</string>
</edit-config>
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
<edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
<string>need to photo library access to save pictures there</string>
</edit-config>
<!-- BUTTON THAT IS CALLING THE FUNCTION -->
<button ng-click="takePic()" style="font-weight:300;border-radius:10px 10px 10px 10px;" class="button button-positive button-block">Take picture</button>
【问题讨论】:
-
我也有同样的问题。
-
你找到解决办法了吗?
标签: javascript ios cordova ionic-framework