Skip to content

react-native-camera with customizable barcode detection area for iOS.

License

Notifications You must be signed in to change notification settings

feong/react-native-camera

 
 

Repository files navigation

Diff with react-native-camera.

This is a git fork from react-native-camera with customzable barcode detection area of iOS.

这个库和社区的react-native-camera的库的区别是在iOS平台上增加了二维码可识别范围。

How to use

<RNCamera
    ref={ref => {
      this.camera = ref;
    }}
    style={styles.preview}
    type={RNCamera.Constants.Type.back}
    flashMode={RNCamera.Constants.FlashMode.on}
    permissionDialogTitle={"Permission to use camera"}
    permissionDialogMessage={
      "We need your permission to use your camera phone"
    }
    onBarCodeRead={data => console.log({ data })}
    barCodeDetectionArea={{ x: 0, y: 0, width: 0.5, height: 0.3 }}
/>

Be careful

The detection area (x, y) is the right-top corner, and the (width) is the height of your screen and the (, height) is the width of your screen. Please refer the apple API and the graqh following.

注意, 二维码的识别区域是右上角坐标系,垂直轴是x轴,水平轴是y轴。

TODO

  • add Android support.
  • change the detection area for natural use.

About

react-native-camera with customizable barcode detection area for iOS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 49.6%
  • Objective-C 41.6%
  • JavaScript 8.1%
  • Other 0.7%