Respond to barcode types of your own camera

I am trying to use react-native-camera@0.4.1 (with react-native@0.39.2 ) to create a QR code scanner. My render() method has the following basic questions:

 <Camera aspect={Camera.constants.Aspect.fill} onBarCodeRead={(data) => console.log(data)} barCodeTypes={['qr']}> </Camera> 

Without barCodeTypes prop, everything works as expected. But as soon as I turn it on, the view is not displayed, and I get the following error message:

 *** -[AVCaptureMetadataOutput setMetadataObjectTypes:] Unsupported type found - use -availableMetadataObjectTypes 

I assume that I just need to write my argument ['qr'] some other and correct way, but I cannot find any information in the documentation .

+6
source share
1 answer

So, I found another stack overflow message that helped me figure out the available methods of MetadataObjectTypes. Therefore, to fix my specific problem, I will just change barCodeTypes={['qr']} to barCodeTypes={['org.iso.QRCode']} .

+2
source

Source: https://habr.com/ru/post/1013929/


All Articles