Mem*_*his 9 javascript ios cordova ionic-framework
我正在使用ionic,Xcode并且cordova-plugin-camera可以访问我的iphone库.它在IOS 11.1.2上运行.
我想所有授权都已设置但是当我点击我的图像选择器库中的图片(图像选择器正在显示)时,我收到此错误:
[发现]发现扩展时遇到的错误:错误域= PlugInKit代码= 13"查询已取消"UserInfo = {NSLocalizedDescription =查询已取消}
关注此主题: PhotoPicker发现错误:错误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,
}
);
};Run Code Online (Sandbox Code Playgroud)
<!--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>Run Code Online (Sandbox Code Playgroud)
有完全相同的问题。阅读文档,它指定:
\n\nNSPhotoLibraryUsageDescription\n虽然此键控制对用户\xe2\x80\x99s 照片库的读写访问,但如果您的应用程序只需将资源添加到库中而不需要添加资源,则最好使用 NSPhotoLibraryAddUsageDescription读取任何资产。
\n\n因此从技术上讲,仅使用 NSPhotoLibraryUsageDescription 就足够了。尝试删除 NSPhotoLibraryAddUsageDescription 但这没有什么区别,无论有没有它,我仍然收到相同的错误消息。
\n| 归档时间: |
|
| 查看次数: |
1283 次 |
| 最近记录: |