我想用 react-native 扫描 GS1 Databar 条码,在 IOS 中也称为 RSS 扩展条码,我正在使用 react-native-qrcode-scanner https://github.com/moaazsidat/react-native-qrcode- scanner 扫描条形码。
<QRCodeScanner
onRead={this.onSuccess}
showMarker={true}
reactivate={false}
flashMode={RNCamera.Constants.FlashMode.auto}
topContent={
<View>
<Text>
Scan Coupon Barcode
</Text>
<Text>Please fit the barcode within the {'\n'} box on the screen.</Text>
</View>
}
cameraStyle={styles.cameraContainer}
topViewStyle={styles.topcontainer}
bottomViewStyle={styles.zeroContainer}
markerStyle={styles.markerStyle}
containerStyle={styles.container}
/>
在安卓上可以正常使用,但在IOS上无法拾取条形码。在 IOS QR Code 中,EAN-8 条码扫描成功,但 GS1 Databar 未被扫描。
没有找到使用 React-Native 在 iOS 上扫描 GS1 Databar Expanded 条形码的有效开源解决方案。
尝试将 Zxingify-ObjC 作为本机模块,但在较新的 iPhone(11 Pro、12)上扫描效果不佳。
试过 react-native-barcode 插件。不支持使用相机扫描仪的 GS1 Databar 插件,但支持从静态图像扫描 GS1 Databar。
终于找到了付费 SDK:Cognex.
希望这可以帮助遇到同样问题的人。
string.replace(/\D/g, "") 将此方法应用于结果字符串。