我正在使用ionic
、Xcode
和cordova-plugin-camera
来访问我的iphone库。它在IOS 11.1.2上运行。
我想所有的授权都设置好了,但是当我单击图像选择库中的图片(图像选择器正在显示)时,我得到了以下错误:
发现扩展时遇到的发现错误: Domain=PlugInKit Code=13“查询取消”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>
发布于 2017-12-03 20:31:10
有完全相同的问题。在阅读文档时,它指定:
NSPhotoLibraryUsageDescription 虽然该键控制对用户照片库的读写访问,但如果应用程序只需要向库添加资产而不需要读取任何资产,则最好使用NSPhotoLibraryAddUsageDescription。
因此,从技术上讲,只使用NSPhotoLibraryUsageDescription就足够了。尝试删除NSPhotoLibraryAddUsageDescription,但这并没有什么区别,我仍然得到了相同的错误消息,不管有没有它。
https://stackoverflow.com/questions/47531010
复制相似问题