我正在使用 ionic
、Xcode
和 cordova-plugin-camera
访问我的 iPhone 库。它正在运行 IOS 11.1.2。
我猜想所有的授权都已经设置好了,但是当我从图像库中点击一张图片(图像选择器正在显示)时,我会得到这个错误:
[discovery] errors encountered while discovering extensions: 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>