yudielcurbelo / react-qr-scanner

A library to scan QR Codes in react.
https://yudielcurbelo.github.io/react-qr-scanner/
MIT License
245 stars 38 forks source link

Camera loading in ionic react-app #43

Closed kyleh27 closed 5 months ago

kyleh27 commented 6 months ago

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

yudielcurbelo commented 5 months ago

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

kyleh27 commented 5 months ago

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

yudielcurbelo commented 5 months ago

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.

kyleh27 commented 5 months ago

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

yudielcurbelo commented 5 months ago

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.