返回介绍

Ionic4 二维码扫描插件-二维码扫描Barcode Scanner

发布于 2019-11-23 07:40:57 字数 1647 浏览 1357 评论 0 收藏 0

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.

https://github.com/phonegap/phonegap-plugin-barcodescanner

Ionic 二维码扫描Barcode Scanner插件的安装(Installation)

ionic cordova plugin add phonegap-plugin-barcodescanner npm install @ionic-native/barcode-scanner 
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/barcode-scanner 

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);
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文