mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 16:52:53 +08:00
feat(regula-document-reader): separate initialization and scanning, add android (#2013)
This commit is contained in:
parent
e65406cc2f
commit
2179699622
@ -13,7 +13,8 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
|
||||
*
|
||||
* let license; // read regula.license file
|
||||
* RegulaDocumentReader.scanDocument(license).then((result) => {
|
||||
* RegulaDocumentReader.initReader(license); // initialize reader
|
||||
* RegulaDocumentReader.scanDocument().then((result) => {
|
||||
* // read result
|
||||
* })
|
||||
* ```
|
||||
@ -23,17 +24,23 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
||||
plugin: 'cordova-plugin-documentreader',
|
||||
pluginRef: 'DocumentReader',
|
||||
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
|
||||
platforms: ['iOS'],
|
||||
platforms: ['iOS', 'Android'],
|
||||
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
|
||||
})
|
||||
@Injectable()
|
||||
export class RegulaDocumentReader extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Run the scanner
|
||||
* Initialize the scanner
|
||||
* @param license {any} License data
|
||||
*/
|
||||
@Cordova()
|
||||
initReader(license: any): void {}
|
||||
|
||||
/**
|
||||
* Run the scanner
|
||||
* @return {Promise<string[]>} Returns a promise that resolves when results was got, and fails when not
|
||||
*/
|
||||
@Cordova()
|
||||
scanDocument(license: any): Promise<string[]> { return; }
|
||||
scanDocument(): Promise<string[]> { return; }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user