mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 09:01:07 +08:00
feat(fingerprint-air): add new functions (#3530)
* Add the new "registerBiometricSecret" and "loadBiometricSecret" methods for 'fingerprint-aio' plugin * Update the response type for `loadBiometricSecret` * Add new error msg for Secret not Found
This commit is contained in:
parent
14ec32b83c
commit
99e6a5398f
@ -39,6 +39,19 @@ export interface FingerprintOptions {
|
|||||||
disableBackup?: boolean;
|
disableBackup?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface FingerprintSecretOptions extends FingerprintOptions {
|
||||||
|
/**
|
||||||
|
* String secret to encrypt and save, use simple strings matching the regex [a-zA-Z0-9\-]+
|
||||||
|
*/
|
||||||
|
secret: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If `true` secret will be deleted when biometry items are deleted or enrolled
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
invalidateOnEnrollment?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Fingerprint AIO
|
* @name Fingerprint AIO
|
||||||
* @description
|
* @description
|
||||||
@ -68,9 +81,30 @@ export interface FingerprintOptions {
|
|||||||
* .then((result: any) => console.log(result))
|
* .then((result: any) => console.log(result))
|
||||||
* .catch((error: any) => console.log(error));
|
* .catch((error: any) => console.log(error));
|
||||||
*
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* this.faio.registerBiometricSecret({
|
||||||
|
* description: "Some biometric description", // optional | Default: null
|
||||||
|
* secret: "my-super-secret", // mandatory
|
||||||
|
* invalidateOnEnrollment: true, // optional | Default: false
|
||||||
|
* disableBackup: true, // (Android Only) | optional | always `true` on Android
|
||||||
|
* })
|
||||||
|
* .then((result: any) => console.log(result))
|
||||||
|
* .catch((error: any) => console.log(error));
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* this.faio.loadBiometricSecret({
|
||||||
|
* description: "Some biometric description", // optional | Default: null
|
||||||
|
* disableBackup: true, // always disabled on Android
|
||||||
|
* })
|
||||||
|
* .then((result: string) => console.log(result))
|
||||||
|
* .catch((error: any) => console.log(error));
|
||||||
|
*
|
||||||
* ```
|
* ```
|
||||||
* @interfaces
|
* @interfaces
|
||||||
* FingerprintOptions
|
* FingerprintOptions
|
||||||
|
* FingerprintSecretOptions
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginName: 'FingerprintAIO',
|
pluginName: 'FingerprintAIO',
|
||||||
@ -146,6 +180,11 @@ export class FingerprintAIO extends IonicNativePlugin {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
BIOMETRIC_LOCKED_OUT_PERMANENT = -112;
|
BIOMETRIC_LOCKED_OUT_PERMANENT = -112;
|
||||||
|
/**
|
||||||
|
* Convenience constant
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
BIOMETRIC_SECRET_NOT_FOUND = -113;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if fingerprint authentication is available
|
* Check if fingerprint authentication is available
|
||||||
@ -156,6 +195,26 @@ export class FingerprintAIO extends IonicNativePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show authentication dialogue and register secret
|
||||||
|
* @param {FingerprintSecretOptions} options Options for platform specific fingerprint API
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when authentication was successful
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
registerBiometricSecret(options: FingerprintSecretOptions): Promise<any> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show authentication dialogue and load secret
|
||||||
|
* @param {FingerprintOptions} options Options for platform specific fingerprint API
|
||||||
|
* @return {Promise<any>} Returns a promise that resolves when authentication was successful
|
||||||
|
*/
|
||||||
|
@Cordova()
|
||||||
|
loadBiometricSecret(options: FingerprintOptions): Promise<string> {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show authentication dialogue
|
* Show authentication dialogue
|
||||||
* @param {FingerprintOptions} options Options for platform specific fingerprint API
|
* @param {FingerprintOptions} options Options for platform specific fingerprint API
|
||||||
|
Loading…
x
Reference in New Issue
Block a user