BarCodeScanner autofocus?

#1

Is there any way to turn autofocus on BarCodeScanner
because our barcodes are pretty complex and the camera has to focus in order to get them
or if there is a different approach id be happy to hear that.
Thanks! -Jovan

#2

Hi,

BarCodeScanner is implemented as Camera with props passed on, so you can just forward the autoFocus prop.

#3

@edgar i tried forward the autoFocus prop it doesnt work am i doing something wrong?

      <BarCodeScanner
        onBarCodeRead={this._handleBarCodeRead}
        style={StyleSheet.absoluteFill}
        barCodeTypes={[BarCodeScanner.Constants.BarCodeType.code128]}
        autoFocus={Camera.Constants.AutoFocus.on}
        focusDepth={1}
        defaultOnFocusComponent
        onFocusChanged={() => {
          console.log('focusChanged');
        }}
        zoom={1}
        onZoomChanged={() => {}}
      />