Barcode Scanner
The Barcode Scanner Plugin opens a camera view and automatically scans a barcode, returning the data back to you.
Requires Cordova plugin: phonegap-plugin-barcodescanner
. For more info, please see the BarcodeScanner plugin docs.
联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.
Ionic 二维码扫描Barcode Scanner插件的安装(Installation)
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
Ionic 二维码扫描Barcode Scanner插件支持的平台(Supported Platforms)
- Android
- BlackBerry 10
- Browser
- iOS
- Windows
Ionic 二维码扫描Barcode Scanner插件的用法(Usage)
import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
constructor(private barcodeScanner: BarcodeScanner) { }
...
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
}).catch(err => {
console.log('Error', err);
});