使用react-native在IOS上扫描GS1 Databar条形码

3

我想在IOS上用React Native扫描GS1 Databar条码,它也被称为RSS Expanded条码,我正在使用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码和EAN-8条形码可以成功扫描,但GS1 Databar无法扫描。

2个回答

1

在使用React-Native开发iOS应用时,我们没有找到有效的开源解决方案来扫描GS1 Databar Expanded条形码。

我们尝试了Zxingify-ObjC这个原生模块,但在新款iPhone(11 Pro、12)上扫描效果较差。

我们也试过react-native-barcode插件。该插件不支持使用相机扫描器扫描GS1 Databar插件,但支持从静态图像中扫描GS1 Databar。

最终我们选择了付费的SDK:Cognex

希望这能帮助遇到同样问题的人。


0

在结果字符串上应用string.replace(/\D/g, "")方法。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接