From 225a44ca4dcd278127cfec0de636d330b5c3d6c0 Mon Sep 17 00:00:00 2001 From: Alex Muramoto Date: Thu, 4 Aug 2016 14:58:35 -0700 Subject: [PATCH] docs(TouchID): Improves formatting of usage docs (#397) * Fixes syntax error in usage example, and improves usage formatting * Moves error codes into usage section --- src/plugins/touchid.ts | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/plugins/touchid.ts b/src/plugins/touchid.ts index 2f922aa14..559aa8054 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. */