Ragesh Pikalmunde
Ragesh Pikalmunde

Reputation: 1403

Cordova plugin add cordova-plugin-camera-with-exif having issue with android

I am working on an ionic 4 project and using a camera plugin to click picture and upload

@ionic-native/camera/ngx    
cordova plugin add cordova-plugin-camera-with-exif

it was working fine earlier but now it is throwing an error

error while getting a picture from the camera

that's it, nothing more than that.

Excepted behavior: after clicking the picture it should have shown an image

const cameraOptions: CameraOptions = {
      sourceType: sourceType,
      destinationType: this.camera.DestinationType.FILE_URI,
      quality: 50,
      encodingType: this.camera.EncodingType.JPEG,
      correctOrientation: true,
      saveToPhotoAlbum: this.saveToPhotoAlbum,
      mediaType: this.camera.MediaType.PICTURE,
      targetWidth: 1000,
      targetHeight: 1000
    }
this.camera.getPicture(cameraOptions).then(result => {
   //nothing happens here
}, (err) => {
   //directly throwing error here
  console.error('There was an error while getting a picture from camera', err);
});

this is working in the older device (android 6) but not working in the new device (android 10) also it is working fine with the iOS devices so I am not sure what's wrong with the plugin or code or anything else.

Upvotes: 0

Views: 700

Answers (0)

Related Questions