Scan QR/barcodes with your NativeScript app.
npm install nativescript-barcodeview[npm-image]:http://img.shields.io/npm/v/nativescript-barcodeview.svg
[npm-url]:https://npmjs.org/package/nativescript-barcodeview
[downloads-image]:http://img.shields.io/npm/dm/nativescript-barcodeview.svg
formats)format property of the result object.* tns plugin add nativescript-barcodeview
Be sure to run a new build after adding plugins to avoid any issues.
---
The nativescript BarcodeView is base on nativescript-barcodescanner from [Eddy Verbruggen]
(https://github.com/EddyVerbruggen)
IMPORTANT: _Make sure you include xmlns:mdc="nativescript-canvas" on the Page element_
``XML`
`typescript`
import { registerElement } from 'nativescript-angular/element-registry';
import { BarcodeView } from 'nativescript-barcodeview';
registerElement('BarcodeView', () => BarcodeView);
`html`
`javascript
import Vue from 'nativescript-vue';
(
`
`html`
Whatever the UI framework you will receive the event in :
`ts
function onScanResult(text:string, barcodeFormat:string) {
}
``
* preferFrontCamera
whether to prefer front camera
* beepOnScan
should i beep?
* reportDuplicates
should i keep on reporting?
* pause
pause camera
* torchOn
you guess right?
ZXing: https://github.com/zxing/zxing/releases
ZXing Android Embedded: https://github.com/journeyapps/zxing-android-embedded