@@ -39,6 +39,19 @@ export interface FingerprintOptions {
39
39
disableBackup ?: boolean ;
40
40
}
41
41
42
+ export interface FingerprintSecretOptions extends FingerprintOptions {
43
+ /**
44
+ * String secret to encrypt and save, use simple strings matching the regex [a-zA-Z0-9\-]+
45
+ */
46
+ secret : string ;
47
+
48
+ /**
49
+ * If `true` secret will be deleted when biometry items are deleted or enrolled
50
+ * @default false
51
+ */
52
+ invalidateOnEnrollment ?: boolean ;
53
+ }
54
+
42
55
/**
43
56
* @name Fingerprint AIO
44
57
* @description
@@ -68,9 +81,30 @@ export interface FingerprintOptions {
68
81
* .then((result: any) => console.log(result))
69
82
* .catch((error: any) => console.log(error));
70
83
*
84
+ * ...
85
+ *
86
+ * this.faio.registerBiometricSecret({
87
+ * description: "Some biometric description", // optional | Default: null
88
+ * secret: "my-super-secret", // mandatory
89
+ * invalidateOnEnrollment: true, // optional | Default: false
90
+ * disableBackup: true, // (Android Only) | optional | always `true` on Android
91
+ * })
92
+ * .then((result: any) => console.log(result))
93
+ * .catch((error: any) => console.log(error));
94
+ *
95
+ * ...
96
+ *
97
+ * this.faio.loadBiometricSecret({
98
+ * description: "Some biometric description", // optional | Default: null
99
+ * disableBackup: true, // always disabled on Android
100
+ * })
101
+ * .then((result: string) => console.log(result))
102
+ * .catch((error: any) => console.log(error));
103
+ *
71
104
* ```
72
105
* @interfaces
73
106
* FingerprintOptions
107
+ * FingerprintSecretOptions
74
108
*/
75
109
@Plugin ( {
76
110
pluginName : 'FingerprintAIO' ,
@@ -146,6 +180,11 @@ export class FingerprintAIO extends IonicNativePlugin {
146
180
* @type {number }
147
181
*/
148
182
BIOMETRIC_LOCKED_OUT_PERMANENT = - 112 ;
183
+ /**
184
+ * Convenience constant
185
+ * @type {number }
186
+ */
187
+ BIOMETRIC_SECRET_NOT_FOUND = - 113 ;
149
188
150
189
/**
151
190
* Check if fingerprint authentication is available
@@ -156,6 +195,26 @@ export class FingerprintAIO extends IonicNativePlugin {
156
195
return ;
157
196
}
158
197
198
+ /**
199
+ * Show authentication dialogue and register secret
200
+ * @param {FingerprintSecretOptions } options Options for platform specific fingerprint API
201
+ * @return {Promise<any> } Returns a promise that resolves when authentication was successful
202
+ */
203
+ @Cordova ( )
204
+ registerBiometricSecret ( options : FingerprintSecretOptions ) : Promise < any > {
205
+ return ;
206
+ }
207
+
208
+ /**
209
+ * Show authentication dialogue and load secret
210
+ * @param {FingerprintOptions } options Options for platform specific fingerprint API
211
+ * @return {Promise<any> } Returns a promise that resolves when authentication was successful
212
+ */
213
+ @Cordova ( )
214
+ loadBiometricSecret ( options : FingerprintOptions ) : Promise < string > {
215
+ return ;
216
+ }
217
+
159
218
/**
160
219
* Show authentication dialogue
161
220
* @param {FingerprintOptions } options Options for platform specific fingerprint API
0 commit comments