I implemented cordova-plugin-camera in my apps, the code as below.
The image is show in emulator, but it doesn’t display in device (I am using Samsung Note 3 to test it).
How do I know what is my problem?
js
Camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it’s base64:
this.imgSrc = “data:image/jpeg;base64,” + imageData;
// this.imgSrc = imageData;
}, (err) => {
});
HTML
<img [src]="imgSrc" id="imgPlacement">
<button block (click)="takePhoto()">
Take Photo
</button>
<button block danger (click)="choosePhoto()">
From Gallery
</button>
Between, I am wondering could it be the picture after capture is not save? Because I can’t find any photo after capture appear in the device, even I have click the save button
yeah, I tried it’s working but, it’s only working in android version 11. it’s not working on android 12, once click the camera it restarts the app. please give a solution