ekreutz / react-native-barcode-scanner-google

Barcode scanner for react native, which implements barcode detection from Google's Vision API.
MIT License
113 stars 68 forks source link

Torch is Not working , i followed the advanced example at it is ? react native: 0.55.4, react: 16.3.1 #30

Closed dileepbolisetti closed 5 years ago

jqn commented 5 years ago

@dileepbolisetti you have to toggle torchmode to on via a user interaction. Torchmode should be initialized to off then toggle to on.

neonrazor commented 5 years ago

Can you give me an example of how to do this, I have set it using a state var but it still doesnt work on my honor P9 lite, the torch just doesnt work. I also noticed the even with the type set to QR the camera still reads barcode, its almost as if its ignoring the props.

ramesh-katreddi commented 5 years ago

Got confused the similar way - Basically it is being considered only after camera initialisation. So if we have a button in the same view where camera is present, on click of it - you can toggle this in state variable.

state - initially - torchMode = OFF

when button is clicked - set torchMode = ON - thats what @jqn was referring to.