Simple Barcode scanner for capacitor, shows popup camera view to scan. Supports code 128 and QR Uses Google MLKit in android, and AVFoundation on iOS
version 1.0.1 updated for capacitor 5 version 2.1.2 updated MLKit version in android
npm i capacitor-barcode-scanner
npx cap sync
Plugin Version | Capacitor Version |
---|---|
0.0.2 | Capacitor 3 |
1.0.1 | Capacitor 5 |
2.0.0 | Capacitor 5 |
2.1.1 | Capacitor 5 |
2.1.2 | Capacitor 5 |
2.2.0 | Capacitor 5+ |
In XCode -> App info.plist add key NSCameraUsageDescription
Promise<ScanResult>
--------------------
### multiScan(...)
```typescript
multiScan(opts?: MultiScanOptions | undefined) => PromiseMultiScanOptions
|
**Returns:** Promise<MultiScanResult>
--------------------
### Interfaces
#### ScanResult
Represents a Scan Result
| Prop | Type | Description |
| ------------ | -------------------- | --------------------------------------------- |
| **`result`** | boolean
| sucess status, its true when scanner got code |
| **`code`** | string
| scanned code |
#### MultiScanResult
Represents a Multiple scan result
| Prop | Type |
| ------------ | --------------------- |
| **`result`** | boolean
|
| **`count`** | number
|
| **`codes`** | string[]
|
#### MultiScanOptions
| Prop | Type | Description |
| -------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **`maxScans`** | number
| Max quantity of codes to scan, when reached the amount activity or viewcontroller will close and return the scanned codes, it defaults to 9999 |