Skip to content

Commit

Permalink
style(README.md): format with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-hartmann committed Oct 29, 2021
1 parent debb8c3 commit e6b16a0
Showing 1 changed file with 44 additions and 32 deletions.
76 changes: 44 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@ The purpose of this project is to provide a barcode scanner utilizing the Google

## Plugin Dependencies

Dependency | Version | Info
---------- | ------- | --------
`cordova-android` | `>=8.0.0`
`cordova-ios` | `>=4.5.0`
`cordova-plugin-androidx` | ` ^3.0.0` | If cordova-android < 9.0.0
`cordova-plugin-androidx-adapter` | ` ^1.1.3`
| Dependency | Version | Info |
| --------------------------------- | --------- | -------------------------- |
| `cordova-android` | `>=8.0.0` | |
| `cordova-ios` | `>=4.5.0` | |
| `cordova-plugin-androidx` | ` ^3.0.0` | If cordova-android < 9.0.0 |
| `cordova-plugin-androidx-adapter` | ` ^1.1.3` | |

## Prerequisites

If your cordova-android version is below 9.0.0, you have to install `cordova-plugin-androidx` first before installing this plugin. Execute this command in your terminal:

```bash
cordova plugin add cordova-plugin-androidx
```

## Installation

Run this command in your project root.

```bash
cordova plugin add cordova-plugin-mlkit-barcode-scanner
```
Expand All @@ -33,31 +36,32 @@ cordova plugin add cordova-plugin-mlkit-barcode-scanner

## Barcode Support

| 1d formats | Android | iOS |
| ----------------------------------------------- | ------- | ------- |
| Codabar || |
| Code 39 || |
| Code 93 || |
| Code 128 || |
| EAN-8. || |
| EAN-13 || |
| ITF || |
| MSI || |
| RSS Expanded || |
| RSS-14 || |
| UPC-A || |
| UPC-E || |

| 2d formats | Android | iOS |
| ----------------------------------------------- | ------- | ------- |
| Aztec || |
| Codablock || |
| Data Matrix || |
| MaxiCode || |
| PDF417 || |
| QR Code || |
| 1d formats | Android | iOS |
| ------------ | ------- | --- |
| Codabar |||
| Code 39 |||
| Code 93 |||
| Code 128 |||
| EAN-8. |||
| EAN-13 |||
| ITF |||
| MSI |||
| RSS Expanded |||
| RSS-14 |||
| UPC-A |||
| UPC-E |||

| 2d formats | Android | iOS |
| ----------- | ------- | --- |
| Aztec |||
| Codablock |||
| Data Matrix |||
| MaxiCode |||
| PDF417 |||
| QR Code |||

:information_source: Note that this API does not recognize barcodes in these forms:

- 1D Barcodes with only one character
- Barcodes in ITF format with fewer than six characters
- Barcodes encoded with FNC2, FNC3 or FNC4
Expand Down Expand Up @@ -97,11 +101,11 @@ const defaultOptions = {
UPCA: true,
UPCE: true,
PDF417: true,
Aztec: true
Aztec: true,
},
detectorSize: 0.6,
mirrorCamera: false
}
mirrorCamera: false,
};
```

### Output/Return value
Expand All @@ -118,30 +122,37 @@ result: {
## Run the test app

Install cordova

```
npm i -g cordova
```

Go to test app

```
cd test/scan-test-app
```

Install node modules

```
npm i
```

Prepare Cordova

```
cordova platform add android && cordova plugin add ../../ --link --force
```

Build and run the project Android

```
cordova build android && cordova run android
```

and iOS

```
cordova build ios && cordova run ios
```
Expand All @@ -150,6 +161,7 @@ cordova build ios && cordova run ios

Under unknown circumstances, an error may occur where the camera is upside down.
Here is a list of devices that have this problem:

- Zebra MC330K (Manufacturer: Zebra Technologies, Model: MC33)

Current Solution: When your device have this problem, you can call the plugin with the option "mirrorCamera" and set its value to true. This will rotate the camera stream by 180 degrees.

0 comments on commit e6b16a0

Please sign in to comment.