2017-11-28 3 views
4

ionic, Xcodecordova-plugin-camera을 사용하여 내 아이폰의 라이브러리에 액세스하고 있습니다. IOS 11.1.2에서 실행됩니다.Cordova 카메라 플러그인 IOS 11이 라이브러리에서 이미지를 선택할 수 없음

[발견] 오류가 발생했습니다

내가 모든 권한이 모두 설정되어 생각하지만 난 내 이미지 피커 라이브러리에서 그림을 클릭있을 때 (이미지 선택 도구가 표시됩니다),이 오류를 받고 있어요 확장을 발견하는 동안 오류 도메인 = PlugInKit 코드 = 13이 주제에 따라 사용자 정보 = {취소 NSLocalizedDescription = 쿼리}

을 "쿼리가 취소" PhotoPicker discovery error: Error Domain=PlugInKit Code=13가이 권한 오류의 부족이 될 수 나타납니다.

아래에서 볼 수 있듯이 Info.plist이 설정되어 있으며 내 실수가있는 곳을 찾을 수 없습니까? 정확히 같은 문제를 갖는 enter image description hereenter image description here

// FUNCTION TO OPEN MY IPHONE'S LIBRARY AND SELECT A PIC 
 

 
$scope.takePic = function() 
 
{ 
 
    navigator.camera.getPicture(
 
    function(uri){ 
 
     //console.log(uri); 
 
    }, 
 

 
    function(){ 
 
\t $ionicPopup.alert({ 
 
\t   title: 'Error', 
 
\t   template: 'Impossible' 
 
\t   }); 
 
    }, 
 
    { 
 
    \t destinationType: 1, 
 
    \t sourceType: Camera.PictureSourceType.PHOTOLIBRARY, 
 
    \t allowEdit: false, 
 
    \t saveToPhotoAlbum: false, 
 
    \t 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>

+0

동일한 문제가 있습니다. – Sifeng

답변

0

enter image description hereenter image description here. 설명서를 읽기, 그것은 지정

NSPhotoLibraryUsageDescription 읽고 사용자의 사진 라이브러리에 대한 쓰기 액세스 권한을 것을 관리이 키 있지만, 앱 라이브러리에 자산을 추가하는 경우에만 필요하고 필요하지 않는 경우 NSPhotoLibraryAddUsageDescription를 사용하는 것이 가장 좋습니다 자산을 읽으십시오.

기술적으로 NSPhotoLibraryUsageDescription 만 사용하면됩니다. NSPhotoLibraryAddUsageDescription을 제거하려고 시도했지만 차이가 없었지만 여전히 같은 오류 메시지가 있거나 없는데,

+1

그래,이 질문을 게시했기 때문에이 불행히도 남아있다 ... 마지막으로 나는 카메라를 사용하여 사용자의 라이브러리 대신 사진을 찍기로 결정했다. 당분간은 사진을 사용하여 아바타를 설정하는 것입니다. 솔루션으로 끝나면 알려 드리겠습니다. 같은 것을 해 주시길 바랍니다, 감사합니다.) – Memphis