diff --git a/src/@ionic-native/plugins/android-fingerprint-auth/index.ts b/src/@ionic-native/plugins/android-fingerprint-auth/index.ts index ff1133e888..2d14f6bcc1 100644 --- a/src/@ionic-native/plugins/android-fingerprint-auth/index.ts +++ b/src/@ionic-native/plugins/android-fingerprint-auth/index.ts @@ -102,7 +102,7 @@ export interface AFAEncryptResponse { * This plugin will open a native dialog fragment prompting the user to authenticate using their fingerprint. If the device has a secure lockscreen (pattern, PIN, or password), the user may opt to authenticate using that method as a backup. * @usage * ```typescript - * import { AndroidFingerprintAuth, AFAAuthOptions } from '@ionic-native/android-fingerprint-auth'; + * import { AndroidFingerprintAuth } from '@ionic-native/android-fingerprint-auth'; * * constructor(private androidFingerprintAuth: AndroidFingerprintAuth) { } * @@ -124,7 +124,7 @@ export interface AFAEncryptResponse { * } else console.log('Didn\'t authenticate!'); * }) * .catch(error => { - * if (error === 'Cancelled') { + * if (error === this.androidFingerprintAuth.ERRORS.FINGERPRINT_CANCELLED) { * console.log('Fingerprint authentication cancelled'); * } else console.error(error) * }); @@ -150,6 +150,27 @@ export interface AFAEncryptResponse { @Injectable() export class AndroidFingerprintAuth extends IonicNativePlugin { + ERRORS: { + BAD_PADDING_EXCEPTION: 'BAD_PADDING_EXCEPTION', + CERTIFICATE_EXCEPTION: 'CERTIFICATE_EXCEPTION', + FINGERPRINT_CANCELLED: 'FINGERPRINT_CANCELLED', + FINGERPRINT_DATA_NOT_DELETED: 'FINGERPRINT_DATA_NOT_DELETED', + FINGERPRINT_ERROR: 'FINGERPRINT_ERROR', + FINGERPRINT_NOT_AVAILABLE: 'FINGERPRINT_NOT_AVAILABLE', + FINGERPRINT_PERMISSION_DENIED: 'FINGERPRINT_PERMISSION_DENIED', + FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST: 'FINGERPRINT_PERMISSION_DENIED_SHOW_REQUEST', + ILLEGAL_BLOCK_SIZE_EXCEPTION: 'ILLEGAL_BLOCK_SIZE_EXCEPTION', + INIT_CIPHER_FAILED: 'INIT_CIPHER_FAILED', + INVALID_ALGORITHM_PARAMETER_EXCEPTION: 'INVALID_ALGORITHM_PARAMETER_EXCEPTION', + IO_EXCEPTION: 'IO_EXCEPTION', + JSON_EXCEPTION: 'JSON_EXCEPTION', + MINIMUM_SDK: 'MINIMUM_SDK', + MISSING_ACTION_PARAMETERS: 'MISSING_ACTION_PARAMETERS', + MISSING_PARAMETERS: 'MISSING_PARAMETERS', + NO_SUCH_ALGORITHM_EXCEPTION: 'NO_SUCH_ALGORITHM_EXCEPTION', + SECURITY_EXCEPTION: 'SECURITY_EXCEPTION' + }; + /** * Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device. * @param options {AFAAuthOptions} Options