@capgo/capacitor-native-biometric 7.6.0 → 8.0.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.
- package/CapgoCapacitorNativeBiometric.podspec +1 -1
- package/Package.swift +2 -2
- package/android/build.gradle +9 -9
- package/android/src/main/java/ee/forgr/biometric/NativeBiometric.java +4 -2
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/web.js +1 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +1 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativeBiometricPlugin/NativeBiometricPlugin.swift +13 -3
- package/package.json +12 -12
|
@@ -8,6 +8,6 @@
|
|
|
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
10
|
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
11
|
-
s.ios.deployment_target = '
|
|
11
|
+
s.ios.deployment_target = '15.0'
|
|
12
12
|
s.dependency 'Capacitor'
|
|
13
13
|
end
|
package/Package.swift
CHANGED
|
@@ -3,14 +3,14 @@ import PackageDescription
|
|
|
3
3
|
|
|
4
4
|
let package = Package(
|
|
5
5
|
name: "CapgoCapacitorNativeBiometric",
|
|
6
|
-
platforms: [.iOS(.
|
|
6
|
+
platforms: [.iOS(.v15)],
|
|
7
7
|
products: [
|
|
8
8
|
.library(
|
|
9
9
|
name: "CapgoCapacitorNativeBiometric",
|
|
10
10
|
targets: ["NativeBiometricPlugin"])
|
|
11
11
|
],
|
|
12
12
|
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
14
|
],
|
|
15
15
|
targets: [
|
|
16
16
|
.target(
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
4
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
5
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.
|
|
3
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
4
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
5
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,18 +11,18 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
apply plugin: 'com.android.library'
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
namespace "ee.forgr.biometric.capacitornativebiometric"
|
|
22
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
21
|
+
namespace = "ee.forgr.biometric.capacitornativebiometric"
|
|
22
|
+
compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
|
|
23
23
|
defaultConfig {
|
|
24
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -34,7 +34,7 @@ android {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
lintOptions {
|
|
37
|
-
abortOnError false
|
|
37
|
+
abortOnError = false
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -337,8 +337,10 @@ public class NativeBiometric extends Plugin {
|
|
|
337
337
|
String KEY_ALIAS = call.getString("server", null);
|
|
338
338
|
|
|
339
339
|
if (KEY_ALIAS != null) {
|
|
340
|
-
SharedPreferences sharedPreferences = getContext()
|
|
341
|
-
|
|
340
|
+
SharedPreferences sharedPreferences = getContext().getSharedPreferences(
|
|
341
|
+
NATIVE_BIOMETRIC_SHARED_PREFERENCES,
|
|
342
|
+
Context.MODE_PRIVATE
|
|
343
|
+
);
|
|
342
344
|
String username = sharedPreferences.getString(KEY_ALIAS + "-username", null);
|
|
343
345
|
String password = sharedPreferences.getString(KEY_ALIAS + "-password", null);
|
|
344
346
|
|
|
@@ -192,7 +192,7 @@ export declare enum BiometricAuthError {
|
|
|
192
192
|
/**
|
|
193
193
|
* Callback type for biometry change listener
|
|
194
194
|
*/
|
|
195
|
-
export
|
|
195
|
+
export type BiometryChangeListener = (result: AvailableResult) => void;
|
|
196
196
|
export interface NativeBiometricPlugin {
|
|
197
197
|
/**
|
|
198
198
|
* Checks if biometric authentication hardware is available.
|
package/dist/esm/web.js
CHANGED
|
@@ -14,6 +14,7 @@ export class NativeBiometricWeb extends WebPlugin {
|
|
|
14
14
|
strongBiometryIsAvailable: false,
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
18
|
async addListener(_eventName, _listener) {
|
|
18
19
|
// Web platform: no-op, but return a valid handle
|
|
19
20
|
return {
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,WAAW;QACT,yEAAyE;QACzE,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,KAAK;YAClB,sBAAsB,EAAE,sBAAsB,CAAC,IAAI;YACnD,YAAY,EAAE,YAAY,CAAC,IAAI;YAC/B,cAAc,EAAE,KAAK;YACrB,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,UAA4B,EAAE,SAAiC;QAC/E,iDAAiD;QACjD,OAAO;YACL,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,2BAA2B;YAC7B,CAAC;SACF,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,QAA2B;QACxC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IAED,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,iBAAiB,CAAC,QAAiC;QACjD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,kBAAkB,CAAC,QAAmC;QACpD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC5C,oDAAoD;QACpD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PluginListenerHandle } 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 BiometryChangeListener,\n} from './definitions';\nimport { BiometryType, AuthenticationStrength } from './definitions';\n\nexport class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {\n constructor() {\n super();\n }\n\n isAvailable(): Promise<AvailableResult> {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n\n async addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle> {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n\n verifyIdentity(_options?: BiometricOptions): Promise<void> {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n\n getCredentials(_options: GetCredentialOptions): Promise<Credentials> {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n\n setCredentials(_options: SetCredentialOptions): Promise<void> {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n\n deleteCredentials(_options: DeleteCredentialOptions): Promise<void> {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n\n isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult> {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,WAAW;QACT,yEAAyE;QACzE,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,WAAW,EAAE,KAAK;YAClB,sBAAsB,EAAE,sBAAsB,CAAC,IAAI;YACnD,YAAY,EAAE,YAAY,CAAC,IAAI;YAC/B,cAAc,EAAE,KAAK;YACrB,yBAAyB,EAAE,KAAK;SACjC,CAAC,CAAC;IACL,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,WAAW,CAAC,UAA4B,EAAE,SAAiC;QAC/E,iDAAiD;QACjD,OAAO;YACL,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,2BAA2B;YAC7B,CAAC;SACF,CAAC;IACJ,CAAC;IAED,cAAc,CAAC,QAA2B;QACxC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IAED,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,cAAc,CAAC,QAA8B;QAC3C,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,iBAAiB,CAAC,QAAiC;QACjD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,kBAAkB,CAAC,QAAmC;QACpD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;QAC5C,oDAAoD;QACpD,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PluginListenerHandle } 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 BiometryChangeListener,\n} from './definitions';\nimport { BiometryType, AuthenticationStrength } from './definitions';\n\nexport class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {\n constructor() {\n super();\n }\n\n isAvailable(): Promise<AvailableResult> {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle> {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n\n verifyIdentity(_options?: BiometricOptions): Promise<void> {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n\n getCredentials(_options: GetCredentialOptions): Promise<Credentials> {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n\n setCredentials(_options: SetCredentialOptions): Promise<void> {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n\n deleteCredentials(_options: DeleteCredentialOptions): Promise<void> {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n\n isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult> {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -129,6 +129,7 @@ class NativeBiometricWeb extends core.WebPlugin {
|
|
|
129
129
|
strongBiometryIsAvailable: false,
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
132
133
|
async addListener(_eventName, _listener) {
|
|
133
134
|
// Web platform: no-op, but return a valid handle
|
|
134
135
|
return {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -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 = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\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 /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\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';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","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,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E;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;AAC/E;AACA,IAAI,kBAAkB,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC;AACnD;AACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAClD;AACA,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC;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 = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\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 /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\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';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","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;AAC5BC;AACX,CAAC,UAAU,sBAAsB,EAAE;AACnC;AACA;AACA;AACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,MAAM,CAAC,G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escript-eslint/no-unused-vars
|
|
131
132
|
async addListener(_eventName, _listener) {
|
|
132
133
|
// Web platform: no-op, but return a valid handle
|
|
133
134
|
return {
|
package/dist/plugin.js.map
CHANGED
|
@@ -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 = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\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 /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\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';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","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;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;IACjF;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IAC3D,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;IACX,CAAC,UAAU,sBAAsB,EAAE;IACnC;IACA;IACA;IACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACvE;IACA;IACA;IACA;IACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;IAC3E;IACA;IACA;IACA;IACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACvE,CAAC,EAAEA,8BAAsB,KAAKA,8BAAsB,GAAG,EAAE,CAAC,CAAC;IAC3D;IACA;IACA;IAC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AM,IAAI,KAAK,CAAC,sDAAsD,CAAC;IAC/E;IACA,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;IAC/E;IACA,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;IAC/E;IACA,IAAI,kBAAkB,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IACnD;IACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClD;IACA,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC;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 = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\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 /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\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';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","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;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;IACjF;IACA,IAA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7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,8 @@ import Foundation
|
|
|
2
2
|
import Capacitor
|
|
3
3
|
import LocalAuthentication
|
|
4
4
|
|
|
5
|
+
// swiftlint:disable type_body_length cyclomatic_complexity
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Please read the Capacitor iOS Plugin Development Guide
|
|
7
9
|
* here: https://capacitor.ionicframework.com/docs/plugins/ios
|
|
@@ -9,7 +11,7 @@ import LocalAuthentication
|
|
|
9
11
|
|
|
10
12
|
@objc(NativeBiometricPlugin)
|
|
11
13
|
public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
12
|
-
private let pluginVersion: String = "
|
|
14
|
+
private let pluginVersion: String = "8.0.1"
|
|
13
15
|
public let identifier = "NativeBiometricPlugin"
|
|
14
16
|
public let jsName = "NativeBiometric"
|
|
15
17
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -242,10 +244,14 @@ public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
242
244
|
|
|
243
245
|
// Store user Credentials in Keychain
|
|
244
246
|
func storeCredentialsInKeychain(_ credentials: Credentials, _ server: String) throws {
|
|
247
|
+
guard let passwordData = credentials.password.data(using: .utf8) else {
|
|
248
|
+
throw KeychainError.unexpectedPasswordData
|
|
249
|
+
}
|
|
250
|
+
|
|
245
251
|
let query: [String: Any] = [kSecClass as String: kSecClassInternetPassword,
|
|
246
252
|
kSecAttrAccount as String: credentials.username,
|
|
247
253
|
kSecAttrServer as String: server,
|
|
248
|
-
kSecValueData as String:
|
|
254
|
+
kSecValueData as String: passwordData]
|
|
249
255
|
|
|
250
256
|
let status = SecItemAdd(query as CFDictionary, nil)
|
|
251
257
|
|
|
@@ -259,7 +265,9 @@ public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
259
265
|
kSecAttrServer as String: server]
|
|
260
266
|
|
|
261
267
|
let account = credentials.username
|
|
262
|
-
let password = credentials.password.data(using: String.Encoding.utf8)
|
|
268
|
+
guard let password = credentials.password.data(using: String.Encoding.utf8) else {
|
|
269
|
+
throw KeychainError.unexpectedPasswordData
|
|
270
|
+
}
|
|
263
271
|
let attributes: [String: Any] = [kSecAttrAccount as String: account,
|
|
264
272
|
kSecValueData as String: password]
|
|
265
273
|
|
|
@@ -352,3 +360,5 @@ public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
352
360
|
call.resolve(["version": self.pluginVersion])
|
|
353
361
|
}
|
|
354
362
|
}
|
|
363
|
+
|
|
364
|
+
// swiftlint:enable type_body_length cyclomatic_complexity
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-native-biometric",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.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",
|
|
@@ -49,23 +49,23 @@
|
|
|
49
49
|
"prepublishOnly": "npm run build"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@capacitor/android": "^
|
|
53
|
-
"@capacitor/core": "^
|
|
54
|
-
"@capacitor/docgen": "^0.3.
|
|
55
|
-
"@capacitor/ios": "^
|
|
52
|
+
"@capacitor/android": "^8.0.0",
|
|
53
|
+
"@capacitor/core": "^8.0.0",
|
|
54
|
+
"@capacitor/docgen": "^0.3.1",
|
|
55
|
+
"@capacitor/ios": "^8.0.0",
|
|
56
56
|
"@ionic/eslint-config": "^0.4.0",
|
|
57
57
|
"@ionic/prettier-config": "^4.0.0",
|
|
58
58
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
59
|
-
"eslint": "^8.57.
|
|
60
|
-
"prettier": "^3.
|
|
61
|
-
"prettier-plugin-java": "^2.
|
|
62
|
-
"rimraf": "^6.0
|
|
63
|
-
"rollup": "^4.
|
|
59
|
+
"eslint": "^8.57.1",
|
|
60
|
+
"prettier": "^3.6.2",
|
|
61
|
+
"prettier-plugin-java": "^2.7.7",
|
|
62
|
+
"rimraf": "^6.1.0",
|
|
63
|
+
"rollup": "^4.53.2",
|
|
64
64
|
"swiftlint": "^2.0.0",
|
|
65
|
-
"typescript": "
|
|
65
|
+
"typescript": "^5.9.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@capacitor/core": ">=
|
|
68
|
+
"@capacitor/core": ">=8.0.0"
|
|
69
69
|
},
|
|
70
70
|
"prettier": "@ionic/prettier-config",
|
|
71
71
|
"swiftlint": "@ionic/swiftlint-config",
|