Skip to content

Commit

Permalink
feat(android-fingerprint-auth): add ERRORS constant (#1470)
Browse files Browse the repository at this point in the history
* Update index.ts

* fix lint

* linter
  • Loading branch information
danielsogl authored and ihadeed committed May 9, 2017
1 parent aa9826f commit ed6044d
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/@ionic-native/plugins/android-fingerprint-auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
*
Expand All @@ -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)
* });
Expand All @@ -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
Expand Down

0 comments on commit ed6044d

Please sign in to comment.