1.1.0 • Published 2 months ago

angular-barcode-scan v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

angular-barcode-scan

Servicio Angular para manejar el plugin Cordova: bardode-scan

install

$ ionic cordova plugin add barcode-scan
$ npm install angular-barcode-scan
app.module.ts:
 import { BarcodeScan,  BarcodeScanModule } from 'angular-barcode-scan';
 
  @NgModule({
   declarations: [
     ...
   ],
   imports: [
     ...
     BarcodeScanModule
   ],
   providers: [
     ...
     BarcodeScan
     ...
   ],
  })

 app.component.html:
  <ion-app>
   <barcode-host-listener [debug]="true"></barcode-host-listener>
  ...
  </ion-app>

Usage

import { Device } from '@awesome-cordova-plugins/device/ngx';
import { BarcodeScan } from 'angular-barcode-scanner';

constructor(
  private barcodeScan: BarcodeScan,
  private device: Device
  ) {}

...
await this.barcodeScan.setBarcodeDevice(this.device.model);

...
await this.barcodeScan.setBarcodeDevice('NQuire300');
await this.barcodeScan.setBarcodeDevice(BarcodeScan.Newland);

...
await this.barcodeScan.clearBarcodeDevice();

...
ICameraOptions {
                preferFrontCamera?: boolean;     
                showFlipCameraButton?: boolean;  
                showTorchButton?: boolean;       
                torchOn?: boolean;               // launch with the torch switched on (if available)
                saveHistory?: boolean;           // save scan history (default false)
                prompt?: string;                 // Android mensaje inferior
                resultDisplayDuration?: number;  // display scanned text for X ms. 0 suppresses it entirely, default 1500
                formats?: string;                // QR_CODE, DATA_MATRIX, UPC_A, UPC_E, EAN_8, EAN_13, CODE_39, CODE_93, CODE_128, CODABAR, ITF, RSS14, PDF_417, RSS_EXPANDED, AZTEC default: all but PDF_417 and RSS_EXPANDED
                orientation?: string;            // portrait | landscape, default unset so it rotates with the device
                disableSuccessBeep?: boolean;    
                device?: string;
              }

this.scannerProvider.scanBarcode(Options?).then((result)=>{
     console.log(result);
  });

...
this.barcodeScan.subscrbeToScan(this.subscribeKey,
   async (value) => {
     this.callbackFunction(value.result);
   }, (err) => {
     console.log(err);
   });

...
this.barcodeScan.unSubscrbeToScan(this.subscribeKey);

Supported platforms

  • Android
1.1.0

2 months ago

1.0.28

3 months ago

1.0.26

3 months ago

1.0.27

3 months ago

1.0.25

4 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.11

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

2 years ago

1.0.10

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago