Mayank Kumar created CB-12689:
---------------------------------

             Summary: Camera chooser not returning selected FILE_URI from 
native explorer when pdf or any other document selected except images.
                 Key: CB-12689
                 URL: https://issues.apache.org/jira/browse/CB-12689
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin Camera
    Affects Versions: 2.4.0, 7.0.0
         Environment: Android Devices having Nougat
            Reporter: Mayank Kumar


When using v2.2.0 on Nougat Android version. This code works fine either i 
select image file or any other document, it returns file url as expected.

But after updating to v2.4.0 on Nougat Android version same code works only for 
images and it fails for any other document. It goes to error block with err 
mesage "Unable to retrieve path to picture!"

I have updated camera plugin version from 2.2.0 to 2.4.0 to fix the camera 
"android.os.FileUriExposedException" on Android Nougat 7.0.  Camera started 
working fine for taking pictures, but it is now failing to choose document from 
device.

var options =   {
    quality: 100,
    destinationType: Camera.DestinationType.FILE_URI,
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
    encodingType: Camera.EncodingType.JPEG
};

$cordovaCamera.getPicture(options).then(

        function(fileURI) {
                console.log(fileURI);
        }, function(err){
                console.log(err);
        }
);



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to