@capgo/capacitor-native-biometric 5.0.1 → 5.1.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/LICENSE +2 -2
- package/{readme.md → README.md} +49 -22
- package/android/build.gradle +9 -9
- package/android/gradlew +8 -4
- package/android/src/main/java/ee/forgr/biometric/AuthActivity.java +69 -37
- package/android/src/main/java/ee/forgr/biometric/NativeBiometric.java +121 -74
- package/dist/docs.json +27 -13
- package/dist/esm/definitions.d.ts +31 -3
- package/dist/esm/definitions.js +27 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +3 -3
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +24 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +26 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Plugin.swift +60 -58
- package/ios/Podfile.lock +4 -4
- package/ios/Pods/Local Podspecs/Capacitor.podspec.json +2 -2
- package/ios/Pods/Local Podspecs/CapacitorCordova.podspec.json +2 -2
- package/ios/Pods/Manifest.lock +4 -4
- package/ios/Pods/Pods.xcodeproj/project.pbxproj +572 -572
- package/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist +1 -1
- package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist +1 -1
- package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh +0 -0
- package/package.json +17 -22
- package/android/.gradle/8.0.2/checksums/checksums.lock +0 -0
- package/android/.gradle/8.0.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/8.0.2/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.0.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/8.0.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.0.2/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.0.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/8.0.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.0.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/8.0.2/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/android.iml +0 -40
- package/android/local.properties +0 -8
- package/ios/Plugin.xcodeproj/project.xcworkspace/xcuserdata/pilito.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Plugin.xcodeproj/xcuserdata/jmartinez.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/Plugin.xcodeproj/xcuserdata/josemartinez.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/Plugin.xcodeproj/xcuserdata/pilito.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/Plugin.xcworkspace/xcuserdata/jmartinez.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Plugin.xcworkspace/xcuserdata/josemartinez.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Plugin.xcworkspace/xcuserdata/pilito.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Pods/Pods.xcodeproj/xcuserdata/jmartinez.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -60
- package/ios/Pods/Pods.xcodeproj/xcuserdata/jmartinez.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/jmartinez.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/jmartinez.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/jmartinez.xcuserdatad/xcschemes/xcschememanagement.plist +0 -39
- package/ios/Pods/Pods.xcodeproj/xcuserdata/josemartinez.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -60
- package/ios/Pods/Pods.xcodeproj/xcuserdata/josemartinez.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/josemartinez.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/josemartinez.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/josemartinez.xcuserdatad/xcschemes/xcschememanagement.plist +0 -39
- package/ios/Pods/Pods.xcodeproj/xcuserdata/martindonadieu.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/martindonadieu.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/martindonadieu.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/martindonadieu.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
- package/ios/Pods/Pods.xcodeproj/xcuserdata/martindonadieu.xcuserdatad/xcschemes/xcschememanagement.plist +0 -31
- package/ios/Pods/Pods.xcodeproj/xcuserdata/pilito.xcuserdatad/xcschemes/xcschememanagement.plist +0 -29
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 BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\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 throw new Error(\"Method not implemented.\");\n }\n getCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n setCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n deleteCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","registerPlugin","WebPlugin"],"mappings":"
|
|
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 throw new Error(\"Method not implemented.\");\n }\n getCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n setCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n deleteCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;;;AACA,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;AACpD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC5D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;AAC1D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC;AAClE;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB,CAAC;AAClF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB,CAAC;AAClF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC5D,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC,CAAC;AAMxC,CAAC,UAAU,kBAAkB,EAAE;AAC/B,IAAI,kBAAkB,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C,CAAC;;ACnC9C,MAAC,eAAe,GAAGC,mBAAc,CAAC,iBAAiB,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;AACtE,CAAC;;ACFM,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,WAAW,GAAG;AAClB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACnD,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
|
-
var
|
|
1
|
+
var capacitorCapacitorBiometric = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
exports.BiometryType = void 0;
|
|
5
4
|
(function (BiometryType) {
|
|
5
|
+
// Android, iOS
|
|
6
6
|
BiometryType[BiometryType["NONE"] = 0] = "NONE";
|
|
7
|
+
// iOS
|
|
7
8
|
BiometryType[BiometryType["TOUCH_ID"] = 1] = "TOUCH_ID";
|
|
9
|
+
// iOS
|
|
8
10
|
BiometryType[BiometryType["FACE_ID"] = 2] = "FACE_ID";
|
|
11
|
+
// Android
|
|
9
12
|
BiometryType[BiometryType["FINGERPRINT"] = 3] = "FINGERPRINT";
|
|
13
|
+
// Android
|
|
10
14
|
BiometryType[BiometryType["FACE_AUTHENTICATION"] = 4] = "FACE_AUTHENTICATION";
|
|
15
|
+
// Android
|
|
11
16
|
BiometryType[BiometryType["IRIS_AUTHENTICATION"] = 5] = "IRIS_AUTHENTICATION";
|
|
17
|
+
// Android
|
|
12
18
|
BiometryType[BiometryType["MULTIPLE"] = 6] = "MULTIPLE";
|
|
13
19
|
})(exports.BiometryType || (exports.BiometryType = {}));
|
|
20
|
+
(function (BiometricAuthError) {
|
|
21
|
+
BiometricAuthError[BiometricAuthError["UNKNOWN_ERROR"] = 0] = "UNKNOWN_ERROR";
|
|
22
|
+
BiometricAuthError[BiometricAuthError["BIOMETRICS_UNAVAILABLE"] = 1] = "BIOMETRICS_UNAVAILABLE";
|
|
23
|
+
BiometricAuthError[BiometricAuthError["USER_LOCKOUT"] = 2] = "USER_LOCKOUT";
|
|
24
|
+
BiometricAuthError[BiometricAuthError["BIOMETRICS_NOT_ENROLLED"] = 3] = "BIOMETRICS_NOT_ENROLLED";
|
|
25
|
+
BiometricAuthError[BiometricAuthError["USER_TEMPORARY_LOCKOUT"] = 4] = "USER_TEMPORARY_LOCKOUT";
|
|
26
|
+
BiometricAuthError[BiometricAuthError["AUTHENTICATION_FAILED"] = 10] = "AUTHENTICATION_FAILED";
|
|
27
|
+
BiometricAuthError[BiometricAuthError["APP_CANCEL"] = 11] = "APP_CANCEL";
|
|
28
|
+
BiometricAuthError[BiometricAuthError["INVALID_CONTEXT"] = 12] = "INVALID_CONTEXT";
|
|
29
|
+
BiometricAuthError[BiometricAuthError["NOT_INTERACTIVE"] = 13] = "NOT_INTERACTIVE";
|
|
30
|
+
BiometricAuthError[BiometricAuthError["PASSCODE_NOT_SET"] = 14] = "PASSCODE_NOT_SET";
|
|
31
|
+
BiometricAuthError[BiometricAuthError["SYSTEM_CANCEL"] = 15] = "SYSTEM_CANCEL";
|
|
32
|
+
BiometricAuthError[BiometricAuthError["USER_CANCEL"] = 16] = "USER_CANCEL";
|
|
33
|
+
BiometricAuthError[BiometricAuthError["USER_FALLBACK"] = 17] = "USER_FALLBACK";
|
|
34
|
+
})(exports.BiometricAuthError || (exports.BiometricAuthError = {}));
|
|
14
35
|
|
|
15
36
|
const NativeBiometric = core.registerPlugin("NativeBiometric", {
|
|
16
37
|
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.NativeBiometricWeb()),
|
|
@@ -44,7 +65,9 @@ var capacitorApp = (function (exports, core) {
|
|
|
44
65
|
|
|
45
66
|
exports.NativeBiometric = NativeBiometric;
|
|
46
67
|
|
|
68
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
69
|
+
|
|
47
70
|
return exports;
|
|
48
71
|
|
|
49
|
-
}
|
|
72
|
+
}({}, capacitorExports));
|
|
50
73
|
//# sourceMappingURL=plugin.js.map
|
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 BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\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 throw new Error(\"Method not implemented.\");\n }\n getCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n setCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n deleteCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","registerPlugin","WebPlugin"],"mappings":";;;
|
|
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 throw new Error(\"Method not implemented.\");\n }\n getCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n setCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n deleteCredentials(_options) {\n throw new Error(\"Method not implemented.\");\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;IACA,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IACpD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC5D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;IAC1D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC;IAClE;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB,CAAC;IAClF;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB,CAAC;IAClF;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC5D,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC,CAAC;IAMxC,CAAC,UAAU,kBAAkB,EAAE;IAC/B,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC;IAClF,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,GAAG,wBAAwB,CAAC;IACpG,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC;IAChF,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,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,WAAW,GAAG;IAClB,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,cAAc,CAAC,QAAQ,EAAE;IAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnD,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -53,21 +53,8 @@ public class NativeBiometric: CAPPlugin {
|
|
|
53
53
|
call.resolve(obj)
|
|
54
54
|
return
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
case LAError.biometryNotAvailable.rawValue:
|
|
59
|
-
errorCode = 1
|
|
60
|
-
|
|
61
|
-
case LAError.biometryLockout.rawValue:
|
|
62
|
-
errorCode = 2 // "Authentication could not continue because the user has been locked out of biometric authentication, due to failing authentication too many times."
|
|
63
|
-
|
|
64
|
-
case LAError.biometryNotEnrolled.rawValue:
|
|
65
|
-
errorCode = 3// message = "Authentication could not start because the user has not enrolled in biometric authentication."
|
|
66
|
-
|
|
67
|
-
default:
|
|
68
|
-
errorCode = 0 // "Did not find error code on LAError object"
|
|
69
|
-
}
|
|
70
|
-
obj["errorCode"] = errorCode
|
|
56
|
+
var pluginErrorCode = convertToPluginErrorCode(authError.code)
|
|
57
|
+
obj["errorCode"] = pluginErrorCode
|
|
71
58
|
call.resolve(obj)
|
|
72
59
|
}
|
|
73
60
|
|
|
@@ -78,7 +65,14 @@ public class NativeBiometric: CAPPlugin {
|
|
|
78
65
|
var canEvaluateError: NSError?
|
|
79
66
|
|
|
80
67
|
let useFallback = call.getBool("useFallback", false)
|
|
81
|
-
context.localizedFallbackTitle =
|
|
68
|
+
context.localizedFallbackTitle = ""
|
|
69
|
+
|
|
70
|
+
if useFallback {
|
|
71
|
+
context.localizedFallbackTitle = nil
|
|
72
|
+
if let fallbackTitle = call.getString("fallbackTitle") {
|
|
73
|
+
context.localizedFallbackTitle = fallbackTitle
|
|
74
|
+
}
|
|
75
|
+
}
|
|
82
76
|
|
|
83
77
|
let policy = useFallback ? LAPolicy.deviceOwnerAuthentication : LAPolicy.deviceOwnerAuthenticationWithBiometrics
|
|
84
78
|
|
|
@@ -91,52 +85,14 @@ public class NativeBiometric: CAPPlugin {
|
|
|
91
85
|
if success {
|
|
92
86
|
call.resolve()
|
|
93
87
|
} else {
|
|
94
|
-
|
|
95
|
-
guard let error = evaluateError
|
|
96
|
-
else {
|
|
88
|
+
guard let error = evaluateError else {
|
|
97
89
|
call.reject("Biometrics Error", "0")
|
|
98
90
|
return
|
|
99
91
|
}
|
|
100
92
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
errorCode = "10"
|
|
105
|
-
|
|
106
|
-
case LAError.appCancel.rawValue:
|
|
107
|
-
errorCode = "11"
|
|
108
|
-
|
|
109
|
-
case LAError.invalidContext.rawValue:
|
|
110
|
-
errorCode = "12"
|
|
111
|
-
|
|
112
|
-
case LAError.notInteractive.rawValue:
|
|
113
|
-
errorCode = "13"
|
|
114
|
-
|
|
115
|
-
case LAError.passcodeNotSet.rawValue:
|
|
116
|
-
errorCode = "14"
|
|
117
|
-
|
|
118
|
-
case LAError.systemCancel.rawValue:
|
|
119
|
-
errorCode = "15"
|
|
120
|
-
|
|
121
|
-
case LAError.userCancel.rawValue:
|
|
122
|
-
errorCode = "16"
|
|
123
|
-
|
|
124
|
-
case LAError.userFallback.rawValue:
|
|
125
|
-
errorCode = "17"
|
|
126
|
-
|
|
127
|
-
case LAError.biometryNotAvailable.rawValue:
|
|
128
|
-
errorCode = "1"
|
|
129
|
-
|
|
130
|
-
case LAError.biometryLockout.rawValue:
|
|
131
|
-
errorCode = "2" // "Authentication could not continue because the user has been locked out of biometric authentication, due to failing authentication too many times."
|
|
132
|
-
|
|
133
|
-
case LAError.biometryNotEnrolled.rawValue:
|
|
134
|
-
errorCode = "3" // message = "Authentication could not start because the user has not enrolled in biometric authentication."
|
|
135
|
-
|
|
136
|
-
default:
|
|
137
|
-
errorCode = "0" // Biometrics unavailable
|
|
138
|
-
}
|
|
139
|
-
call.reject(error.localizedDescription, errorCode, error )
|
|
93
|
+
var pluginErrorCode = self.convertToPluginErrorCode(error._code)
|
|
94
|
+
// use pluginErrorCode.description to convert Int to String
|
|
95
|
+
call.reject(error.localizedDescription, pluginErrorCode.description, error )
|
|
140
96
|
}
|
|
141
97
|
|
|
142
98
|
}
|
|
@@ -261,4 +217,50 @@ public class NativeBiometric: CAPPlugin {
|
|
|
261
217
|
let status = SecItemDelete(query as CFDictionary)
|
|
262
218
|
guard status == errSecSuccess || status == errSecItemNotFound else { throw KeychainError.unhandledError(status: status) }
|
|
263
219
|
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Convert Auth Error Codes to plugin expected Biometric Auth Errors (in README.md)
|
|
223
|
+
* This way both iOS and Android return the same error codes for the soame authentication failure reasons.
|
|
224
|
+
* !!IMPORTANT!!: Whenever this if modified, check if similar function in Android AuthActitivy.java needs to be modified as well.
|
|
225
|
+
* @see https://developer.apple.com/documentation/localauthentication/laerror/code
|
|
226
|
+
*/
|
|
227
|
+
func convertToPluginErrorCode(_ errorCode: Int) -> Int {
|
|
228
|
+
switch errorCode {
|
|
229
|
+
case LAError.biometryNotAvailable.rawValue:
|
|
230
|
+
return 1
|
|
231
|
+
|
|
232
|
+
case LAError.biometryLockout.rawValue:
|
|
233
|
+
return 2
|
|
234
|
+
|
|
235
|
+
case LAError.biometryNotEnrolled.rawValue:
|
|
236
|
+
return 3
|
|
237
|
+
|
|
238
|
+
case LAError.authenticationFailed.rawValue:
|
|
239
|
+
return 10
|
|
240
|
+
|
|
241
|
+
case LAError.appCancel.rawValue:
|
|
242
|
+
return 11
|
|
243
|
+
|
|
244
|
+
case LAError.invalidContext.rawValue:
|
|
245
|
+
return 12
|
|
246
|
+
|
|
247
|
+
case LAError.notInteractive.rawValue:
|
|
248
|
+
return 13
|
|
249
|
+
|
|
250
|
+
case LAError.passcodeNotSet.rawValue:
|
|
251
|
+
return 14
|
|
252
|
+
|
|
253
|
+
case LAError.systemCancel.rawValue:
|
|
254
|
+
return 15
|
|
255
|
+
|
|
256
|
+
case LAError.userCancel.rawValue:
|
|
257
|
+
return 16
|
|
258
|
+
|
|
259
|
+
case LAError.userFallback.rawValue:
|
|
260
|
+
return 17
|
|
261
|
+
|
|
262
|
+
default:
|
|
263
|
+
return 0
|
|
264
|
+
}
|
|
265
|
+
}
|
|
264
266
|
}
|
package/ios/Podfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
- Capacitor (5.0.
|
|
2
|
+
- Capacitor (5.0.0):
|
|
3
3
|
- CapacitorCordova
|
|
4
|
-
- CapacitorCordova (5.0.
|
|
4
|
+
- CapacitorCordova (5.0.0)
|
|
5
5
|
|
|
6
6
|
DEPENDENCIES:
|
|
7
7
|
- "Capacitor (from `../node_modules/@capacitor/ios`)"
|
|
@@ -14,8 +14,8 @@ EXTERNAL SOURCES:
|
|
|
14
14
|
:path: "../node_modules/@capacitor/ios"
|
|
15
15
|
|
|
16
16
|
SPEC CHECKSUMS:
|
|
17
|
-
Capacitor:
|
|
18
|
-
CapacitorCordova:
|
|
17
|
+
Capacitor: b332cb737d447561e854039fb72195206685dce2
|
|
18
|
+
CapacitorCordova: 4ea17670ee562680988a7ce9db68dee5160fe564
|
|
19
19
|
|
|
20
20
|
PODFILE CHECKSUM: 1033dea949db4aa66cc0404a8baadac4a30dd025
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Capacitor",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"summary": "Capacitor for iOS",
|
|
5
5
|
"social_media_url": "https://twitter.com/capacitorjs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"source": {
|
|
15
15
|
"git": "https://github.com/ionic-team/capacitor.git",
|
|
16
|
-
"tag": "5.0.
|
|
16
|
+
"tag": "5.0.0"
|
|
17
17
|
},
|
|
18
18
|
"source_files": [
|
|
19
19
|
"Capacitor/Capacitor/*.{swift,h,m}",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "CapacitorCordova",
|
|
3
3
|
"module_name": "Cordova",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"summary": "Capacitor Cordova Compatibility Layer",
|
|
6
6
|
"homepage": "https://capacitorjs.com",
|
|
7
7
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"source": {
|
|
12
12
|
"git": "https://github.com/ionic-team/capacitor",
|
|
13
|
-
"tag": "5.0.
|
|
13
|
+
"tag": "5.0.0"
|
|
14
14
|
},
|
|
15
15
|
"platforms": {
|
|
16
16
|
"ios": "13.0"
|
package/ios/Pods/Manifest.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
- Capacitor (5.0.
|
|
2
|
+
- Capacitor (5.0.0):
|
|
3
3
|
- CapacitorCordova
|
|
4
|
-
- CapacitorCordova (5.0.
|
|
4
|
+
- CapacitorCordova (5.0.0)
|
|
5
5
|
|
|
6
6
|
DEPENDENCIES:
|
|
7
7
|
- "Capacitor (from `../node_modules/@capacitor/ios`)"
|
|
@@ -14,8 +14,8 @@ EXTERNAL SOURCES:
|
|
|
14
14
|
:path: "../node_modules/@capacitor/ios"
|
|
15
15
|
|
|
16
16
|
SPEC CHECKSUMS:
|
|
17
|
-
Capacitor:
|
|
18
|
-
CapacitorCordova:
|
|
17
|
+
Capacitor: b332cb737d447561e854039fb72195206685dce2
|
|
18
|
+
CapacitorCordova: 4ea17670ee562680988a7ce9db68dee5160fe564
|
|
19
19
|
|
|
20
20
|
PODFILE CHECKSUM: 1033dea949db4aa66cc0404a8baadac4a30dd025
|
|
21
21
|
|