diff --git a/src/plugins/touchid.ts b/src/plugins/touchid.ts index 2f922aa1..559aa805 100644 --- a/src/plugins/touchid.ts +++ b/src/plugins/touchid.ts @@ -8,6 +8,29 @@ import { Cordova, Plugin } from './plugin'; * * Requires Cordova plugin: `cordova-plugin-touch-id`. For more info, please see the [TouchID plugin docs](https://github.com/EddyVerbruggen/cordova-plugin-touch-id). * + * @usage + * ### Import Touch ID Plugin into Project + * ```typescript + * import { TouchID } from 'ionic-native'; + * ``` + * ### Check for Touch ID Availability + * ```typescript + * TouchID.isAvailable() + * .then( + * res => console.log('TouchID is available!'), + * err => console.error('TouchID is not available', err) + * ); + * ``` + * ### Invoke Touch ID w/ Custom Message + * + * ```typescript + * TouchID.verifyFingerprint('Scan your fingerprint please') + * .then( + * res => console.log('Ok', res), + * err => console.error('Error', err) + * ); + * ``` + * * ### Error Codes * * The plugin will reject for various reasons. Your app will most likely need to respond to the cases differently. @@ -20,23 +43,6 @@ import { Cordova, Plugin } from './plugin'; * - `-4` - The scan was cancelled by the system (Home button for example) * - `-6` - TouchID is not Available * - `-8` - TouchID is locked out from too many tries - * @usage - * ```typescript - * import { TouchID } from 'ionic-native'; - * - * - * TouchID.isAvailable() - * .then( - * res => console.log('TouchID is available!'), - * err => console.error("TouchID isn't available", err) - * ); - * - * TouchID.verifyFingerprint('Scan your fingerprint please') - * .then( - * res => console.log('Ok', res), - * err => console.error('Error', err) - * ); - * ``` */ @Plugin({ plugin: 'cordova-plugin-touch-id', @@ -47,7 +53,7 @@ import { Cordova, Plugin } from './plugin'; export class TouchID { /** - * Whether TouchID is available or not. + * Checks Whether TouchID is available or not. * * @return {Promise} Returns a Promise that resolves if yes, rejects if no. */