feat(biometric-wrapper): add plugin (#3025)

This commit is contained in:
pranav9k 2019-06-03 10:24:50 +05:30 committed by Daniel Sogl
parent a2fe674a3f
commit c0b092b242

View File

@ -0,0 +1,59 @@
import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/**
* @name BiometricWrapper
* @description
* This plugin capture biometric(Iris and Fingerprint) and validate the user.
* May be used in Banking domain
*
* @usage
* ```typescript
* import { BiometricWrapper } from '@ionic-native/biometric-wrapper/ngx';
*
*
* constructor(private biometricWrapper: BiometricWrapper) { }
*
* ...
*
*
* this.biometricWrapper.activateIris({'PID_XML': '<pid-xml/>'})
* .then((res: any) => )
* .catch((error: any) => );
*
* ```
*/
@Plugin({
pluginName: 'BiometricWrapper',
plugin: 'cordova-plugin-biometric',
pluginRef: 'cordova.plugins.BiometricWrapper',
repo: '',
install: '',
installVariables: [],
platforms: ['Android']
})
@Injectable()
export class BiometricWrapper extends IonicNativePlugin {
/**
* This function activate iris activity
* @return {Promise<any>} Returns a promise that resolves when iris data captured
*/
@Cordova()
activateIris(args: any): Promise<any> {
return;
}
/**
* This function activate fingerprint activity
* @return {Promise<any>} Returns a promise that resolves when FP data captured
*/
@Cordova()
activateFingerprint(args: any): Promise<any> {
return;
}
}