feat(android-fingerprint-auth): add ERRORS constant (#1470)

* Update index.ts

* fix lint

* linter
This commit is contained in:
Daniel Sogl 2017-05-09 23:38:30 +02:00 committed by Ibby Hadeed
parent aa9826f657
commit ed6044d4e8

View File

@ -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