Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70804

Unable to open camera using native camera function on some android device

$
0
0

how to fix on some android device that unable to open native camera ?

this is my ionic info and im using @ionic-native/camera@5.36.0.

im using standard code to access native camera , but some android device like OPPO A93 and OnePlus , cannot open native camera.

i already tested on Iphone, and some android device such as redmi , vivo and it work like a charm

Ionic:

   Ionic CLI                     : 6.17.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.5.4
   @angular-devkit/build-angular : 0.1101.4
   @angular-devkit/schematics    : 11.1.4
   @angular/cli                  : 11.1.4
   @ionic/angular-toolkit        : 3.1.0

Capacitor:

   Capacitor CLI      : 2.4.6
   @capacitor/android : 2.4.6
   @capacitor/core    : 2.4.6
   @capacitor/ios     : 2.4.6

Utility:

   cordova-res : not installed globally
   native-run  : 1.5.0

System:

   NodeJS : v14.18.1 (/usr/local/bin/node)
   npm    : 6.14.15
   OS     : macOS Monterey
AccessCamera(){    
    const options: CameraOptions = {
      quality: 50,
      correctOrientation: true,
      // allowEdit: true,
      destinationType: this.camera.DestinationType.DATA_URL,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE
    }
    this.camera.getPicture(options).then((ImageData => {
      this.pic.base64img = "data:image/jpeg;base64," + ImageData;
    }), error => {
      console.log(error);
    })
  }

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70804

Trending Articles