This commit is contained in:
Ibby Hadeed 2017-08-23 19:34:55 -04:00
parent a2cc1870b4
commit fe02c84fd9

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core';
/** /**
* @name Keychain Touch Id * @name Keychain Touch Id
@ -35,7 +35,6 @@ export class KeychainTouchId extends IonicNativePlugin {
/** /**
* Check if Touch ID / Fingerprint is supported by the device * Check if Touch ID / Fingerprint is supported by the device
*
* @return {Promise<any>} Returns a promise that resolves when there is hardware support * @return {Promise<any>} Returns a promise that resolves when there is hardware support
*/ */
@Cordova() @Cordova()
@ -46,61 +45,44 @@ export class KeychainTouchId extends IonicNativePlugin {
/** /**
* Encrypts and Saves a password under the key in the device keychain, which can be retrieved after * Encrypts and Saves a password under the key in the device keychain, which can be retrieved after
* successful authentication using fingerprint * successful authentication using fingerprint
*
* @param key {string} the key you want to store * @param key {string} the key you want to store
* @param password {string} the password you want to encrypt and store * @param password {string} the password you want to encrypt and store
* @return {Promise<any>} Returns a promise that resolves when there is a result * @return {Promise<any>} Returns a promise that resolves when there is a result
*/ */
@Cordova() @Cordova()
save(key: string, passwrod: string): Promise<any> { save(key: string, password: string): Promise<any> { return; }
return;
}
/** /**
* Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve * Opens the fingerprint dialog, for the given key, showing an additional message. Promise will resolve
* with the password stored in keychain or will resolve an error code, where -1 indicated not available. * with the password stored in keychain or will resolve an error code, where -1 indicated not available.
*
* @param key {string} the key you want to retrieve from keychain * @param key {string} the key you want to retrieve from keychain
* @param message {string} a message to the user * @param message {string} a message to the user
* @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error * @return {Promise<any>} Returns a promise that resolves when the key value is successfully retrieved or an error
*/ */
@Cordova() @Cordova()
verify(key: string, message: string): Promise<any> { verify(key: string, message: string): Promise<any> { return; }
return;
}
/** /**
* Checks if there is a password stored within the keychain for the given key. * Checks if there is a password stored within the keychain for the given key.
*
* @param key {string} the key you want to check from keychain * @param key {string} the key you want to check from keychain
* @return {Promise<any>} Returns a promise that resolves with success if the key * @return {Promise<any>} Returns a promise that resolves with success if the key is available or failure if key is not.
* is available or failure if key is not
*/ */
@Cordova() @Cordova()
has(key: string): Promise<any> { has(key: string): Promise<any> { return; }
return;
}
/** /**
* Deletes the password stored under given key from the keychain. * Deletes the password stored under given key from the keychain.
*
* @param key {string} the key you want to delete from keychain * @param key {string} the key you want to delete from keychain
* @return {Promise<any>} Returns a promise that resolves with success if the key * @return {Promise<any>} Returns a promise that resolves with success if the key is deleted or failure if key is not
* is deleted or failure if key is not
*/ */
@Cordova() @Cordova()
delete(key: string): Promise<any> { delete(key: string): Promise<any> { return; }
return;
}
/** /**
* Sets the language of the fingerprint dialog * Sets the language of the fingerprint dialog
* * @param locale {string} locale subtag from [this list](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
* @param locale {string} locale subtag from this list
* https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
*
*/ */
@Cordova() @Cordova()
setLocale(locale: string): void { } setLocale(locale: string): void {}
} }