我有离子项目扫描条形码,我使用的是@ionic-native/barcode-scanner,它在iOS上工作得很好,但在安卓系统中,当我调用扫描方法时,相机打开,当它捕捉到条形码时,应用程序崩溃,然后转到根页面(登录)。我正在使用LG Nexus android 6.0,有人能帮我吗?
this.barcodeScanner.scan().then((data) => {
this.addProduct(data.text);
}, (err) => {
console.log(err);
});离子:
离子(离子CLI):4.0.1 (/usr/local/lib/node_node/ ionic ) 离子框架:离子-角3.9.2 @离子/应用程序-脚本: 3.1.10
科多瓦:
cordova (Cordova CLI):7.1.0 Cordova平台: android 7.1.1、browser 5.0.3、ios 4.5.5
系统:
ios-部署: 1.9.2 NodeJS : v6.10.0 (/usr/local/bin/node) npm :6.2.0OS: macOS : Xcode 9.4.1构建9F2000版本
发布于 2018-08-01 09:48:56
我在onPauseSubscription中添加了app.component,所以当我调用条形码扫描器时,它只在android中自动调用这个事件。我把它拿走了,现在起作用了。
this.onPauseSubscription = platform.pause.subscribe(() => {
console.log('onPauseSubscription'); // 30 sn
this.logout();
});https://stackoverflow.com/questions/51597189
复制相似问题