15

I'm using ionic, Xcode and the cordova-plugin-camera to access to my iphone's library. It's running on IOS 11.1.2.

I guess all authorizations are all set but when I'm clicking on a pic from my image picker library (the image picker is displaying), I'm getting this error :

[discovery] errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}

Following this topic : PhotoPicker discovery error: Error Domain=PlugInKit Code=13 it appears this could be a lack of permission error.

As you can see below, the Info.plist is set, I can't find where my mistake is, any ideas ?

enter image description hereenter image description hereenter 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(){
    $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>
Memphis
  • 410
  • 5
  • 23

1 Answers1

0

Having exactly the same issue. Reading the documentation, it specifies:

NSPhotoLibraryUsageDescription Although this keys governs read and write access to the user’s photo library, it’s best to use NSPhotoLibraryAddUsageDescription if your app needs only to add assets to the library and does not need to read any assets.

So technically, only using NSPhotoLibraryUsageDescription should suffice. Tried to remove the NSPhotoLibraryAddUsageDescription but that didn't make a difference, I still got the same error message with or without it.

user134167
  • 195
  • 3
  • 9
  • 2
    Yep, since I've posted this question this issu unfortunately remains... Finally I decided to use the Camera to take a picture instead of using user's library. For now it will to the job, it is just to use a picture to set an avatar. If I ended up with a solution, I'll let you know, hope you'll do the same, thank you ;) – Memphis Dec 05 '17 at 09:38
  • did you find a solution ? – Seb Apr 28 '18 at 23:32
  • have you gone back and tried using the library yet? or still just using the camera? – DigitalMystery Aug 15 '18 at 11:57