-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fingerprint-aio): add cordova-plugin-fingerprint-aio (#845)
- Loading branch information
1 parent
229f550
commit 1615b74
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { Plugin, Cordova} from './plugin'; | ||
|
||
|
||
export interface FingerprintOptions { | ||
/** | ||
* Key for platform keychain | ||
*/ | ||
clientId: string; | ||
|
||
/** | ||
* Secret password. Only for android | ||
*/ | ||
clientSecret?: string; | ||
} | ||
|
||
/** | ||
* @name FingerprintAIO | ||
* @description | ||
* Use simple fingerprint authentication on Android and iOS. | ||
* Requires Cordova plugin: cordova-plugin-fingerprint-aio. For more info about plugin, vist: https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio | ||
* | ||
* @usage | ||
* ```typescript | ||
* import { FingerprintAIO } from 'ionic-native'; | ||
* | ||
* FingerprintAIO.show({ | ||
* clientId: "Fingerprint-Demo", | ||
* clientSecret: "password" //Only necessary for Android | ||
* }) | ||
* .then((result: any) => console.log(any)) | ||
* .catch((error: any) => console.log(error)); | ||
* | ||
* ``` | ||
* @interfaces | ||
* FingerprintOptions | ||
*/ | ||
@Plugin({ | ||
pluginName: 'FingerprintAIO', | ||
plugin: 'cordova-plugin-fingerprint-aio', | ||
pluginRef: 'Fingerprint', | ||
repo: 'https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio', | ||
platforms: ['Android', 'iOS'] | ||
}) | ||
export class FingerprintAIO { | ||
|
||
/** | ||
* Check if fingerprint authentication is available | ||
* @return {Promise<any>} Returns a promise with result | ||
*/ | ||
@Cordova() | ||
static isAvailable(): Promise<any> { | ||
return; | ||
} | ||
|
||
/** | ||
* Show authentication dialogue | ||
* @param options {FingerprintOptions} options for platform specific fingerprint API | ||
* @return {Promise<any>} Returns a promise that resolves when authentication was successfull | ||
*/ | ||
@Cordova() | ||
static show(options: FingerprintOptions): Promise<any> { | ||
return; | ||
} | ||
|
||
} |