mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-01 02:53:03 +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';
|
* import { RegulaDocumentReader } from '@ionic-native/regula-document-reader';
|
||||||
*
|
*
|
||||||
* let license; // read regula.license file
|
* let license; // read regula.license file
|
||||||
* RegulaDocumentReader.scanDocument(license).then((result) => {
|
* RegulaDocumentReader.initReader(license); // initialize reader
|
||||||
|
* RegulaDocumentReader.scanDocument().then((result) => {
|
||||||
* // read result
|
* // read result
|
||||||
* })
|
* })
|
||||||
* ```
|
* ```
|
||||||
@ -23,17 +24,23 @@ import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
|
|||||||
plugin: 'cordova-plugin-documentreader',
|
plugin: 'cordova-plugin-documentreader',
|
||||||
pluginRef: 'DocumentReader',
|
pluginRef: 'DocumentReader',
|
||||||
repo: 'https://github.com/regulaforensics/cordova-plugin-documentreader.git',
|
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"',
|
install: 'ionic plugin add cordova-plugin-documentreader --variable CAMERA_USAGE_DESCRIPTION="To take photo"',
|
||||||
})
|
})
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RegulaDocumentReader extends IonicNativePlugin {
|
export class RegulaDocumentReader extends IonicNativePlugin {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run the scanner
|
* Initialize the scanner
|
||||||
* @param license {any} License data
|
* @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
|
* @return {Promise<string[]>} Returns a promise that resolves when results was got, and fails when not
|
||||||
*/
|
*/
|
||||||
@Cordova()
|
@Cordova()
|
||||||
scanDocument(license: any): Promise<string[]> { return; }
|
scanDocument(): Promise<string[]> { return; }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user