Reputation: 56
I am developing a web app with react native for web, and I want to scan qrcode but it does not work, without errors.
I put the codes on snack, ran it on mobile with Expo Go, it worked perfectly. However, when I published it on github web, and open it with mobile browser (iOS Safari), the camera worked normally, but no qrcode was read (just no reponse when I put a qrcode inside).
Code info: I referred sample code on expo-camera and expo-barcode-scanner. Since expo-barcode-scanner does not support web, I imported expo-camera only.
Version info:
Also, I checked this issue, and tried the followings:
npm i
under root dirBut it still did not work.
I feel confused now, did I take wrong solutions? Is there any workarounds?
Any suggestions would be appreciated.
Upvotes: 2
Views: 764
Reputation: 56
When scanning QR code, the barCodeScannerSetting
is required. Like this:
barCodeScannerSettings={{ barCodeTypes: [BarCodeScanner.Constants.BarCodeType.qr], }}
Upvotes: 0