docs(TouchID): Improves formatting of usage docs (#397)
* Fixes syntax error in usage example, and improves usage formatting * Moves error codes into usage section
This commit is contained in:
parent
cabeeb8dab
commit
225a44ca4d
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user