A cordova plugin for QRCode read.
- read local QRCode image
// uri example
cordova.plugins.ASCDVBarcode.readBarcode(
{ imageType: 0, uri: image.substr('file://'.length) },
results => {
console.log(results);
},
error => {
alert('read bar code error');
}
);
// base64 example
cordova.plugins.ASCDVBarcode.readBarcode(
{ imageType: 1, base64: image },
results => {
console.log(results);
},
error => {
alert('read bar code error');
}
);
ASCDVBarcode.readBarcode(options: ReadOptions, successCallback: (results: [string]) => void, errorCallback: (error) => void)
name | type | description |
---|---|---|
imageType | string | 0: uri; 1: base64 |
uri | string | if imageType == 0, set uri to image path. don't prefix with file://
|
base64 | string | if imageType == 1, set base64 to base64 string |