Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12689

Camera chooser not returning selected FILE_URI from native explorer when pdf or any other document selected except images.

    XMLWordPrintableJSON

Details

    • Important

    Description

      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); }

      );

      Attachments

        Activity

          People

            Unassigned Unassigned
            mayank.logiciel Mayank Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: