@capgo/capacitor-native-biometric 7.1.16 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
 
2
2
  Pod::Spec.new do |s|
3
3
  s.name = 'CapgoCapacitorNativeBiometric'
4
- s.version = '0.0.1'
4
+ s.version = '7.1.13'
5
5
  s.summary = 'This plugin gives access to the native biometric apis for android and iOS'
6
6
  s.license = 'MIT'
7
7
  s.homepage = 'https://github.com/Cap-go/capacitor-native-biometric'
8
8
  s.author = 'Martin Donadieu'
9
9
  s.source = { :git => 'https://github.com/Cap-go/capacitor-native-biometric', :tag => s.version.to_s }
10
- s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
10
+ s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
11
11
  s.ios.deployment_target = '14.0'
12
12
  s.dependency 'Capacitor'
13
13
  end
package/Package.swift CHANGED
@@ -7,22 +7,22 @@ let package = Package(
7
7
  products: [
8
8
  .library(
9
9
  name: "CapgoCapacitorNativeBiometric",
10
- targets: ["CapgoNativeBiometricPlugin"])
10
+ targets: ["NativeBiometricPlugin"])
11
11
  ],
12
12
  dependencies: [
13
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
14
14
  ],
15
15
  targets: [
16
16
  .target(
17
- name: "CapgoNativeBiometricPlugin",
17
+ name: "NativeBiometricPlugin",
18
18
  dependencies: [
19
19
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
20
20
  .product(name: "Cordova", package: "capacitor-swift-pm")
21
21
  ],
22
- path: "ios/Sources/CapgoNativeBiometricPlugin"),
22
+ path: "ios/Sources/NativeBiometricPlugin"),
23
23
  .testTarget(
24
- name: "CapgoNativeBiometricPluginTests",
25
- dependencies: ["CapgoNativeBiometricPlugin"],
24
+ name: "NativeBiometricPluginTests",
25
+ dependencies: ["NativeBiometricPlugin"],
26
26
  path: "ios/Tests/CapgoNativeBiometricPluginTests")
27
27
  ]
28
28
  )
package/README.md CHANGED
@@ -85,6 +85,7 @@ This is a plugin specific list of error codes that can be thrown on verifyIdenti
85
85
  * [`getCredentials(...)`](#getcredentials)
86
86
  * [`setCredentials(...)`](#setcredentials)
87
87
  * [`deleteCredentials(...)`](#deletecredentials)
88
+ * [`isCredentialsSaved(...)`](#iscredentialssaved)
88
89
  * [Interfaces](#interfaces)
89
90
  * [Enums](#enums)
90
91
 
@@ -182,6 +183,25 @@ Deletes the stored credentials for a given server.
182
183
  --------------------
183
184
 
184
185
 
186
+ ### isCredentialsSaved(...)
187
+
188
+ ```typescript
189
+ isCredentialsSaved(options: IsCredentialsSavedOptions) => Promise<IsCredentialsSavedResult>
190
+ ```
191
+
192
+ Checks if credentials are already saved for a given server.
193
+
194
+ | Param | Type |
195
+ | ------------- | ------------------------------------------------------------------------------- |
196
+ | **`options`** | <code><a href="#iscredentialssavedoptions">IsCredentialsSavedOptions</a></code> |
197
+
198
+ **Returns:** <code>Promise&lt;<a href="#iscredentialssavedresult">IsCredentialsSavedResult</a>&gt;</code>
199
+
200
+ **Since:** 7.3.0
201
+
202
+ --------------------
203
+
204
+
185
205
  ### Interfaces
186
206
 
187
207
 
@@ -247,6 +267,20 @@ Deletes the stored credentials for a given server.
247
267
  | **`server`** | <code>string</code> |
248
268
 
249
269
 
270
+ #### IsCredentialsSavedResult
271
+
272
+ | Prop | Type |
273
+ | ------------- | -------------------- |
274
+ | **`isSaved`** | <code>boolean</code> |
275
+
276
+
277
+ #### IsCredentialsSavedOptions
278
+
279
+ | Prop | Type |
280
+ | ------------ | ------------------- |
281
+ | **`server`** | <code>string</code> |
282
+
283
+
250
284
  ### Enums
251
285
 
252
286
 
@@ -291,6 +291,24 @@ public class NativeBiometric extends Plugin {
291
291
  }
292
292
  }
293
293
 
294
+ @PluginMethod
295
+ public void isCredentialsSaved(final PluginCall call) {
296
+ String KEY_ALIAS = call.getString("server", null);
297
+
298
+ if (KEY_ALIAS != null) {
299
+ SharedPreferences sharedPreferences = getContext()
300
+ .getSharedPreferences(NATIVE_BIOMETRIC_SHARED_PREFERENCES, Context.MODE_PRIVATE);
301
+ String username = sharedPreferences.getString(KEY_ALIAS + "-username", null);
302
+ String password = sharedPreferences.getString(KEY_ALIAS + "-password", null);
303
+
304
+ JSObject ret = new JSObject();
305
+ ret.put("isSaved", username != null && password != null);
306
+ call.resolve(ret);
307
+ } else {
308
+ call.reject("No server name was provided");
309
+ }
310
+ }
311
+
294
312
  private String encryptString(String stringToEncrypt, String KEY_ALIAS) throws GeneralSecurityException, IOException {
295
313
  Cipher cipher;
296
314
  cipher = Cipher.getInstance(TRANSFORMATION);
package/dist/docs.json CHANGED
@@ -176,6 +176,41 @@
176
176
  "DeleteCredentialOptions"
177
177
  ],
178
178
  "slug": "deletecredentials"
179
+ },
180
+ {
181
+ "name": "isCredentialsSaved",
182
+ "signature": "(options: IsCredentialsSavedOptions) => Promise<IsCredentialsSavedResult>",
183
+ "parameters": [
184
+ {
185
+ "name": "options",
186
+ "docs": "",
187
+ "type": "IsCredentialsSavedOptions"
188
+ }
189
+ ],
190
+ "returns": "Promise<IsCredentialsSavedResult>",
191
+ "tags": [
192
+ {
193
+ "name": "param",
194
+ "text": "options"
195
+ },
196
+ {
197
+ "name": "returns"
198
+ },
199
+ {
200
+ "name": "memberof",
201
+ "text": "NativeBiometricPlugin"
202
+ },
203
+ {
204
+ "name": "since",
205
+ "text": "7.3.0"
206
+ }
207
+ ],
208
+ "docs": "Checks if credentials are already saved for a given server.",
209
+ "complexTypes": [
210
+ "IsCredentialsSavedResult",
211
+ "IsCredentialsSavedOptions"
212
+ ],
213
+ "slug": "iscredentialssaved"
179
214
  }
180
215
  ],
181
216
  "properties": []
@@ -397,6 +432,38 @@
397
432
  "type": "string"
398
433
  }
399
434
  ]
435
+ },
436
+ {
437
+ "name": "IsCredentialsSavedResult",
438
+ "slug": "iscredentialssavedresult",
439
+ "docs": "",
440
+ "tags": [],
441
+ "methods": [],
442
+ "properties": [
443
+ {
444
+ "name": "isSaved",
445
+ "tags": [],
446
+ "docs": "",
447
+ "complexTypes": [],
448
+ "type": "boolean"
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "name": "IsCredentialsSavedOptions",
454
+ "slug": "iscredentialssavedoptions",
455
+ "docs": "",
456
+ "tags": [],
457
+ "methods": [],
458
+ "properties": [
459
+ {
460
+ "name": "server",
461
+ "tags": [],
462
+ "docs": "",
463
+ "complexTypes": [],
464
+ "type": "string"
465
+ }
466
+ ]
400
467
  }
401
468
  ],
402
469
  "enums": [
@@ -63,6 +63,12 @@ export interface SetCredentialOptions {
63
63
  export interface DeleteCredentialOptions {
64
64
  server: string;
65
65
  }
66
+ export interface IsCredentialsSavedOptions {
67
+ server: string;
68
+ }
69
+ export interface IsCredentialsSavedResult {
70
+ isSaved: boolean;
71
+ }
66
72
  /**
67
73
  * Keep this in sync with BiometricAuthError in README.md
68
74
  * Update whenever `convertToPluginErrorCode` functions are modified
@@ -123,4 +129,12 @@ export interface NativeBiometricPlugin {
123
129
  * @since 1.0.0
124
130
  */
125
131
  deleteCredentials(options: DeleteCredentialOptions): Promise<void>;
132
+ /**
133
+ * Checks if credentials are already saved for a given server.
134
+ * @param {IsCredentialsSavedOptions} options
135
+ * @returns {Promise<IsCredentialsSavedResult>}
136
+ * @memberof NativeBiometricPlugin
137
+ * @since 7.3.0
138
+ */
139
+ isCredentialsSaved(options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult>;
126
140
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,eAAe;IACf,+CAAQ,CAAA;IACR,MAAM;IACN,uDAAY,CAAA;IACZ,MAAM;IACN,qDAAW,CAAA;IACX,UAAU;IACV,6DAAe,CAAA;IACf,UAAU;IACV,6EAAuB,CAAA;IACvB,UAAU;IACV,6EAAuB,CAAA;IACvB,UAAU;IACV,uDAAY,CAAA;AACd,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAiED;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAcX;AAdD,WAAY,kBAAkB;IAC5B,6EAAiB,CAAA;IACjB,+FAA0B,CAAA;IAC1B,2EAAgB,CAAA;IAChB,iGAA2B,CAAA;IAC3B,+FAA0B,CAAA;IAC1B,8FAA0B,CAAA;IAC1B,wEAAe,CAAA;IACf,kFAAoB,CAAA;IACpB,kFAAoB,CAAA;IACpB,oFAAqB,CAAA;IACrB,8EAAkB,CAAA;IAClB,0EAAgB,CAAA;IAChB,8EAAkB,CAAA;AACpB,CAAC,EAdW,kBAAkB,KAAlB,kBAAkB,QAc7B","sourcesContent":["export enum BiometryType {\n // Android, iOS\n NONE = 0,\n // iOS\n TOUCH_ID = 1,\n // iOS\n FACE_ID = 2,\n // Android\n FINGERPRINT = 3,\n // Android\n FACE_AUTHENTICATION = 4,\n // Android\n IRIS_AUTHENTICATION = 5,\n // Android\n MULTIPLE = 6,\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\n\nexport interface IsAvailableOptions {\n /**\n * Specifies if should fallback to passcode authentication if biometric authentication is not available.\n */\n useFallback: boolean;\n}\n\nexport interface AvailableResult {\n isAvailable: boolean;\n biometryType: BiometryType;\n errorCode?: number;\n}\n\nexport interface BiometricOptions {\n reason?: string;\n title?: string;\n subtitle?: string;\n description?: string;\n negativeButtonText?: string;\n /**\n * Specifies if should fallback to passcode authentication if biometric authentication fails.\n */\n useFallback?: boolean;\n /**\n * Only for iOS.\n * Set the text for the fallback button in the authentication dialog.\n * If this property is not specified, the default text is set by the system.\n */\n fallbackTitle?: string;\n /**\n * Only for Android.\n * Set a maximum number of attempts for biometric authentication. The maximum allowed by android is 5.\n * @default 1\n */\n maxAttempts?: number;\n /**\n * Only for Android.\n * Specify which biometry types are allowed for authentication.\n * If not specified, all available types will be allowed.\n * @example [BiometryType.FINGERPRINT, BiometryType.FACE_AUTHENTICATION]\n */\n allowedBiometryTypes?: BiometryType[];\n}\n\nexport interface GetCredentialOptions {\n server: string;\n}\n\nexport interface SetCredentialOptions {\n username: string;\n password: string;\n server: string;\n}\n\nexport interface DeleteCredentialOptions {\n server: string;\n}\n\n/**\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport enum BiometricAuthError {\n UNKNOWN_ERROR = 0,\n BIOMETRICS_UNAVAILABLE = 1,\n USER_LOCKOUT = 2,\n BIOMETRICS_NOT_ENROLLED = 3,\n USER_TEMPORARY_LOCKOUT = 4,\n AUTHENTICATION_FAILED = 10,\n APP_CANCEL = 11,\n INVALID_CONTEXT = 12,\n NOT_INTERACTIVE = 13,\n PASSCODE_NOT_SET = 14,\n SYSTEM_CANCEL = 15,\n USER_CANCEL = 16,\n USER_FALLBACK = 17,\n}\n\nexport interface NativeBiometricPlugin {\n /**\n * Checks if biometric authentication hardware is available.\n * @param {IsAvailableOptions} [options]\n * @returns {Promise<AvailableResult>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n isAvailable(options?: IsAvailableOptions): Promise<AvailableResult>;\n /**\n * Prompts the user to authenticate with biometrics.\n * @param {BiometricOptions} [options]\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n verifyIdentity(options?: BiometricOptions): Promise<void>;\n /**\n * Gets the stored credentials for a given server.\n * @param {GetCredentialOptions} options\n * @returns {Promise<Credentials>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n getCredentials(options: GetCredentialOptions): Promise<Credentials>;\n /**\n * Stores the given credentials for a given server.\n * @param {SetCredentialOptions} options\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n setCredentials(options: SetCredentialOptions): Promise<void>;\n /**\n * Deletes the stored credentials for a given server.\n * @param {DeleteCredentialOptions} options\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n deleteCredentials(options: DeleteCredentialOptions): Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACtB,eAAe;IACf,+CAAQ,CAAA;IACR,MAAM;IACN,uDAAY,CAAA;IACZ,MAAM;IACN,qDAAW,CAAA;IACX,UAAU;IACV,6DAAe,CAAA;IACf,UAAU;IACV,6EAAuB,CAAA;IACvB,UAAU;IACV,6EAAuB,CAAA;IACvB,UAAU;IACV,uDAAY,CAAA;AACd,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAyED;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAcX;AAdD,WAAY,kBAAkB;IAC5B,6EAAiB,CAAA;IACjB,+FAA0B,CAAA;IAC1B,2EAAgB,CAAA;IAChB,iGAA2B,CAAA;IAC3B,+FAA0B,CAAA;IAC1B,8FAA0B,CAAA;IAC1B,wEAAe,CAAA;IACf,kFAAoB,CAAA;IACpB,kFAAoB,CAAA;IACpB,oFAAqB,CAAA;IACrB,8EAAkB,CAAA;IAClB,0EAAgB,CAAA;IAChB,8EAAkB,CAAA;AACpB,CAAC,EAdW,kBAAkB,KAAlB,kBAAkB,QAc7B","sourcesContent":["export enum BiometryType {\n // Android, iOS\n NONE = 0,\n // iOS\n TOUCH_ID = 1,\n // iOS\n FACE_ID = 2,\n // Android\n FINGERPRINT = 3,\n // Android\n FACE_AUTHENTICATION = 4,\n // Android\n IRIS_AUTHENTICATION = 5,\n // Android\n MULTIPLE = 6,\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\n\nexport interface IsAvailableOptions {\n /**\n * Specifies if should fallback to passcode authentication if biometric authentication is not available.\n */\n useFallback: boolean;\n}\n\nexport interface AvailableResult {\n isAvailable: boolean;\n biometryType: BiometryType;\n errorCode?: number;\n}\n\nexport interface BiometricOptions {\n reason?: string;\n title?: string;\n subtitle?: string;\n description?: string;\n negativeButtonText?: string;\n /**\n * Specifies if should fallback to passcode authentication if biometric authentication fails.\n */\n useFallback?: boolean;\n /**\n * Only for iOS.\n * Set the text for the fallback button in the authentication dialog.\n * If this property is not specified, the default text is set by the system.\n */\n fallbackTitle?: string;\n /**\n * Only for Android.\n * Set a maximum number of attempts for biometric authentication. The maximum allowed by android is 5.\n * @default 1\n */\n maxAttempts?: number;\n /**\n * Only for Android.\n * Specify which biometry types are allowed for authentication.\n * If not specified, all available types will be allowed.\n * @example [BiometryType.FINGERPRINT, BiometryType.FACE_AUTHENTICATION]\n */\n allowedBiometryTypes?: BiometryType[];\n}\n\nexport interface GetCredentialOptions {\n server: string;\n}\n\nexport interface SetCredentialOptions {\n username: string;\n password: string;\n server: string;\n}\n\nexport interface DeleteCredentialOptions {\n server: string;\n}\n\nexport interface IsCredentialsSavedOptions {\n server: string;\n}\n\nexport interface IsCredentialsSavedResult {\n isSaved: boolean;\n}\n\n/**\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport enum BiometricAuthError {\n UNKNOWN_ERROR = 0,\n BIOMETRICS_UNAVAILABLE = 1,\n USER_LOCKOUT = 2,\n BIOMETRICS_NOT_ENROLLED = 3,\n USER_TEMPORARY_LOCKOUT = 4,\n AUTHENTICATION_FAILED = 10,\n APP_CANCEL = 11,\n INVALID_CONTEXT = 12,\n NOT_INTERACTIVE = 13,\n PASSCODE_NOT_SET = 14,\n SYSTEM_CANCEL = 15,\n USER_CANCEL = 16,\n USER_FALLBACK = 17,\n}\n\nexport interface NativeBiometricPlugin {\n /**\n * Checks if biometric authentication hardware is available.\n * @param {IsAvailableOptions} [options]\n * @returns {Promise<AvailableResult>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n isAvailable(options?: IsAvailableOptions): Promise<AvailableResult>;\n /**\n * Prompts the user to authenticate with biometrics.\n * @param {BiometricOptions} [options]\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n verifyIdentity(options?: BiometricOptions): Promise<void>;\n /**\n * Gets the stored credentials for a given server.\n * @param {GetCredentialOptions} options\n * @returns {Promise<Credentials>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n getCredentials(options: GetCredentialOptions): Promise<Credentials>;\n /**\n * Stores the given credentials for a given server.\n * @param {SetCredentialOptions} options\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n setCredentials(options: SetCredentialOptions): Promise<void>;\n /**\n * Deletes the stored credentials for a given server.\n * @param {DeleteCredentialOptions} options\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n deleteCredentials(options: DeleteCredentialOptions): Promise<void>;\n /**\n * Checks if credentials are already saved for a given server.\n * @param {IsCredentialsSavedOptions} options\n * @returns {Promise<IsCredentialsSavedResult>}\n * @memberof NativeBiometricPlugin\n * @since 7.3.0\n */\n isCredentialsSaved(options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { NativeBiometricPlugin, AvailableResult, BiometricOptions, GetCredentialOptions, SetCredentialOptions, DeleteCredentialOptions, Credentials } from './definitions';
2
+ import type { NativeBiometricPlugin, AvailableResult, BiometricOptions, GetCredentialOptions, SetCredentialOptions, DeleteCredentialOptions, IsCredentialsSavedOptions, IsCredentialsSavedResult, Credentials } from './definitions';
3
3
  export declare class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {
4
4
  constructor();
5
5
  isAvailable(): Promise<AvailableResult>;
@@ -7,4 +7,5 @@ export declare class NativeBiometricWeb extends WebPlugin implements NativeBiome
7
7
  getCredentials(_options: GetCredentialOptions): Promise<Credentials>;
8
8
  setCredentials(_options: SetCredentialOptions): Promise<void>;
9
9
  deleteCredentials(_options: DeleteCredentialOptions): Promise<void>;
10
+ isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult>;
10
11
  }
package/dist/esm/web.js CHANGED
@@ -22,5 +22,9 @@ export class NativeBiometricWeb extends WebPlugin {
22
22
  console.log('deleteCredentials', _options);
23
23
  throw new Error('Method not implemented.');
24
24
  }
25
+ isCredentialsSaved(_options) {
26
+ console.log('isCredentialsSaved', _options);
27
+ throw new Error('Method not implemented.');
28
+ }
25
29
  }
26
30
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5C,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IACD,WAAW;QACT,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,QAA2B;QACxC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,iBAAiB,CAAC,QAAiC;QACjD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n NativeBiometricPlugin,\n AvailableResult,\n BiometricOptions,\n GetCredentialOptions,\n SetCredentialOptions,\n DeleteCredentialOptions,\n Credentials,\n} from './definitions';\n\nexport class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {\n constructor() {\n super();\n }\n isAvailable(): Promise<AvailableResult> {\n throw new Error('Method not implemented.');\n }\n\n verifyIdentity(_options?: BiometricOptions): Promise<void> {\n console.log('verifyIdentity', _options);\n throw new Error('Method not implemented.');\n }\n getCredentials(_options: GetCredentialOptions): Promise<Credentials> {\n console.log('getCredentials', _options);\n throw new Error('Method not implemented.');\n }\n setCredentials(_options: SetCredentialOptions): Promise<void> {\n console.log('setCredentials', _options);\n throw new Error('Method not implemented.');\n }\n deleteCredentials(_options: DeleteCredentialOptions): Promise<void> {\n console.log('deleteCredentials', _options);\n throw new Error('Method not implemented.');\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAc5C,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IACD,WAAW;QACT,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,cAAc,CAAC,QAA2B;QACxC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,iBAAiB,CAAC,QAAiC;QACjD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,kBAAkB,CAAC,QAAmC;QACpD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n NativeBiometricPlugin,\n AvailableResult,\n BiometricOptions,\n GetCredentialOptions,\n SetCredentialOptions,\n DeleteCredentialOptions,\n IsCredentialsSavedOptions,\n IsCredentialsSavedResult,\n Credentials,\n} from './definitions';\n\nexport class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {\n constructor() {\n super();\n }\n isAvailable(): Promise<AvailableResult> {\n throw new Error('Method not implemented.');\n }\n\n verifyIdentity(_options?: BiometricOptions): Promise<void> {\n console.log('verifyIdentity', _options);\n throw new Error('Method not implemented.');\n }\n getCredentials(_options: GetCredentialOptions): Promise<Credentials> {\n console.log('getCredentials', _options);\n throw new Error('Method not implemented.');\n }\n setCredentials(_options: SetCredentialOptions): Promise<void> {\n console.log('setCredentials', _options);\n throw new Error('Method not implemented.');\n }\n deleteCredentials(_options: DeleteCredentialOptions): Promise<void> {\n console.log('deleteCredentials', _options);\n throw new Error('Method not implemented.');\n }\n isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult> {\n console.log('isCredentialsSaved', _options);\n throw new Error('Method not implemented.');\n }\n}\n"]}
@@ -67,6 +67,10 @@ class NativeBiometricWeb extends core.WebPlugin {
67
67
  console.log('deleteCredentials', _options);
68
68
  throw new Error('Method not implemented.');
69
69
  }
70
+ isCredentialsSaved(_options) {
71
+ console.log('isCredentialsSaved', _options);
72
+ throw new Error('Method not implemented.');
73
+ }
70
74
  }
71
75
 
72
76
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\n/**\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n throw new Error('Method not implemented.');\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Method not implemented.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Method not implemented.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Method not implemented.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACnD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAA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AAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\n/**\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n throw new Error('Method not implemented.');\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Method not implemented.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Method not implemented.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Method not implemented.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Method not implemented.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACnD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AACzD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;AACjE;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AACvC;AACA;AACA;AACA;AACWC;AACX,CAAC,UAAU,kBAAkB,EAAE;AAC/B,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe;AACjF,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,GAAG,wBAAwB;AACnG,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc;AAC/E,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,GAAG,yBAAyB;AACrG,IAAI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AQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA,IAAI,kBAAkB,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC;AACnD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;AAClD;AACA;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -66,6 +66,10 @@ var capacitorCapacitorBiometric = (function (exports, core) {
66
66
  console.log('deleteCredentials', _options);
67
67
  throw new Error('Method not implemented.');
68
68
  }
69
+ isCredentialsSaved(_options) {
70
+ console.log('isCredentialsSaved', _options);
71
+ throw new Error('Method not implemented.');
72
+ }
69
73
  }
70
74
 
71
75
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\n/**\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n throw new Error('Method not implemented.');\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Method not implemented.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Method not implemented.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Method not implemented.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACnD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IAC3D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IACzD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;IACjE;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;IACjF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CAAC;IAClD;IACA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\n/**\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n throw new Error('Method not implemented.');\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Method not implemented.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Method not implemented.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Method not implemented.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Method not implemented.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n throw new Error('Method not implemented.');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACnD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,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C,QAAQ,EAAE;IAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD;IACA,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD;IACA,IAAI,kBAAkB,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IACnD,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC;IAClD;IACA;;;;;;;;;;;;;;;"}
@@ -7,16 +7,17 @@ import LocalAuthentication
7
7
  * here: https://capacitor.ionicframework.com/docs/plugins/ios
8
8
  */
9
9
 
10
- @objc(CapgoNativeBiometricPlugin)
11
- public class CapgoNativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
12
- public let identifier = "CapgoNativeBiometricPlugin"
10
+ @objc(NativeBiometricPlugin)
11
+ public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
12
+ public let identifier = "NativeBiometricPlugin"
13
13
  public let jsName = "NativeBiometric"
14
14
  public let pluginMethods: [CAPPluginMethod] = [
15
15
  CAPPluginMethod(name: "isAvailable", returnType: CAPPluginReturnPromise),
16
16
  CAPPluginMethod(name: "verifyIdentity", returnType: CAPPluginReturnPromise),
17
17
  CAPPluginMethod(name: "getCredentials", returnType: CAPPluginReturnPromise),
18
18
  CAPPluginMethod(name: "setCredentials", returnType: CAPPluginReturnPromise),
19
- CAPPluginMethod(name: "deleteCredentials", returnType: CAPPluginReturnPromise)
19
+ CAPPluginMethod(name: "deleteCredentials", returnType: CAPPluginReturnPromise),
20
+ CAPPluginMethod(name: "isCredentialsSaved", returnType: CAPPluginReturnPromise)
20
21
  ]
21
22
  struct Credentials {
22
23
  var username: String
@@ -164,6 +165,27 @@ public class CapgoNativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
164
165
  }
165
166
  }
166
167
 
168
+ @objc func isCredentialsSaved(_ call: CAPPluginCall) {
169
+ guard let server = call.getString("server") else {
170
+ call.reject("No server name was provided")
171
+ return
172
+ }
173
+
174
+ var obj = JSObject()
175
+ obj["isSaved"] = checkCredentialsExist(server)
176
+ call.resolve(obj)
177
+ }
178
+
179
+ // Check if credentials exist in Keychain
180
+ func checkCredentialsExist(_ server: String) -> Bool {
181
+ let query: [String: Any] = [kSecClass as String: kSecClassInternetPassword,
182
+ kSecAttrServer as String: server,
183
+ kSecMatchLimit as String: kSecMatchLimitOne]
184
+
185
+ let status = SecItemCopyMatching(query as CFDictionary, nil)
186
+ return status == errSecSuccess
187
+ }
188
+
167
189
  // Store user Credentials in Keychain
168
190
  func storeCredentialsInKeychain(_ credentials: Credentials, _ server: String) throws {
169
191
  let query: [String: Any] = [kSecClass as String: kSecClassInternetPassword,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-native-biometric",
3
- "version": "7.1.16",
3
+ "version": "7.3.1",
4
4
  "description": "This plugin gives access to the native biometric apis for android and iOS",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",