Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #SB-0000 chore: readme #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# cordova-plugin-qr-scanner

This plugin provides QR Code scanning feature on Android and iOS devices. Plugin uses camera for scanning the QR code and returns the decoded value.


## Installation

With Ionic:

`ionic cordova plugin add cordova-plugin-qr-scanner`

With Cordova:

`cordova plugin add cordova-plugin-qr-scanner`

## API

### startScanner
To start scanning a QR code call this method. Once called the device will open camera and start looking for the QR code, once QR code is scanner succesfully, camera will close and returns the scanned data to callback function.

|Argument|Description|
|--|--|
|`screenTitle`|On camera screen top a text to be shown|
|`displayText`|Text to displayed below the title on camera screen|
|`displayTextColor`|Display text color|
|`buttonText`|Button text shown on camera screen|
|`showButton`|Wheather to show button or not, boolean value|
|`isRTL`|Is the App using right-to-left language direction or not, boolean value|
|`successCallback`|Success handler function|
|`errorCallback`|Error handler function|


```js
qrScanner.startScanner(screenTitle, displayText, displayTextColor, buttonText, showButton, isRTL,
(scannedData) => {
console.log('Success');
}, (error) => {
console.error('Failed to scann QR code');
});
```

### stopScanner
If the scanning has to be stopped in between or to cancel scanning.

```js
qrScanner.stopScanner(successCallback, errorCallback);
```

## Support

|Platform|
|-|
|Android|
|iOS|