Scan QR/barcodes with your NativeScript app.
npm install @nativescript-community/ui-barcodeview[npm-image]:http://img.shields.io/npm/v/@nativescript-community/ui-barcodeview.svg
[npm-url]:https://npmjs.org/package/@nativescript-community/ui-barcodeview
[downloads-image]:http://img.shields.io/npm/dm/@nativescript-community/ui-barcodeview.svg
formats)format property of the result object.* tns plugin add @nativescript-community/ui-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-community/ui-barcodeview" on the Page element_
``XML`
`typescript`
import { registerElement } from 'nativescript-angular/element-registry';
import { BarcodeView } from '@nativescript-community/ui-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
With latest ZXing versions android minSdkVersion is bumped to 24. You can still lower it https://github.com/journeyapps/zxing-android-embedded#option-2-desugaring-advanced