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

Ionic Capacitor Camera working on browser but not in devapp

$
0
0

@sharatdotinfo wrote:

Hi,

I just wrote a simple app using Capacitor to capture an image and display in the app and it’s working fine on the web browser on my laptop but just the image piece doesn’t work on devapp. Not sure how to fix it. Any help is appreciated.

Here is some code I used:

export class UploadPage {
yourImage: SafeResourceUrl;

constructor(private sanitizer: DomSanitizer) { }

async captureImage() {
const capturedImage = await Plugins.Camera.getPhoto(
{
quality: 90,
allowEditing: false,
source: CameraSource.Camera,
resultType: CameraResultType.DataUrl
}
);

this.yourImage = this.sanitizer.bypassSecurityTrustResourceUrl(capturedImage && (capturedImage.dataUrl));

}

}

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70763

Trending Articles