yudielcurbelo/react-qr-scanner

Camera loading in ionic react-app

kyleh27 opened this issue · 5 comments

when I try to use the scanner in an ionic react app for my android phone, the app runs fine on my laptop webapp and the camera opens, but whenever I build in android studio and try to launch the app on my android device it just shows a big triangle play icon and the word loading
Screenshot_20240521-105851_camera-scanner

I'm not sure about Ionic, but you could try the new beta and let me know 2.0.0-beta.8.

I got it to work after restarting my pc and android device (idk why), but thank you for the quick reply. Also there is no QrScanner exported in the beta versions and I wanted to use the onDecode so I'm using the 1.2.10 version. For starting and stopping the scanner

The onDecode was removed for onScan. onScan return an array, since now is possible to scan multiple QR Codes at the same time. If you only one Qr Code, just get the first element of it. You can try the beta, it is faster and has a much smaller package size.

am I doing this wrong? because this is what i get when I treat it as an array
image
image

This is the type that is returned

export interface IDetectedBarcode {
    boundingBox: IBoundingBox;
    cornerPoints: IPoint[];
    format: string;
    rawValue: string;
}

You should use rawValue instead of text.