Skip to content

Commit

Permalink
feat(regula-document-reader): separate initialization and scanning, a…
Browse files Browse the repository at this point in the history
…dd android (#2013)
  • Loading branch information
DzmitrySmaliakou authored and ihadeed committed Oct 6, 2017
1 parent e65406c commit 2179699
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/@ionic-native/plugins/regula-document-reader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
* })
* ```
Expand All @@ -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; }
}

0 comments on commit 2179699

Please sign in to comment.