cordova-plugin-easyqrcode
v1.0.8
Published
fork of cordova-plugin-zbar This plugin integrates with the [ZBar](http://zbar.sourceforge.net/) library, exposing a JavaScript interface for scanning barcodes (QR Code, EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5, etc). In this fork
Downloads
10
Maintainers
Readme
Cordova-plugin-easyqrcode
fork of cordova-plugin-zbar This plugin integrates with the ZBar library, exposing a JavaScript interface for scanning barcodes (QR Code, EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5, etc). In this fork a button has been added to turn off and on device flash. In addition the plugin can now handle the device orientation change.
Install the plugin using:
cordova plugin add cordova-plugin-easyqrcode
Supported Platforms
- Android
- iOS
Use the plugin in your JS file:
cloudSky.zBar.scan(params, onSuccess, onFailure);
- **params**: Optional parameters:
```javascript
{
text_title: "OPTIONAL Title Text - default = 'Scan QR Code'", // Android only
text_content: "OPTIONAL Instruction Text - default = 'Please point your camera at the QR code.'", // Android only
text_instructions: "OPTIONAL Instruction Text - default = 'Please point your camera at the QR code.'", // Android only
camera: "front" || "back" // defaults to "back"
flash: "on" || "off" || "auto" // defaults to "auto". See Quirks
drawSight: true || false //defaults to true, create a red sight/line in the center of the scanner view.
}
```
- **onSuccess**: function (s) {...} _Callback for successful scan._
- **onFailure**: function (s) {...} _Callback for cancelled scan or error._
Example:
declare const cloudSky: any;
cloudSky.zBar.scan({camera:"back"}, (success)=>{}), (failure)=>{};