@aparajita/capacitor-biometric-auth 4.0.0 → 5.0.0

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/README.md CHANGED
@@ -32,7 +32,7 @@ The API is extensively documented in the [TypeScript definitions file](src/defin
32
32
 
33
33
  ### Checking availability
34
34
 
35
- Before giving the user the option to use biometry (such as displaying a biometry icon), call [`checkBiometry`](#checkbiometry) and inspect the [`CheckBiometryResult`](#checkbiometryresult) to see what (if any) biometry is available on the device. Note that `isAvailable` may be `false` but `biometryType` may indicate the presence of biometry on the device. This occurs if the current user is not enrolled in biometry, or if biometry has been disabled for the current app. In such cases the `reason` will tell you why.
35
+ Before giving the user the option to use biometry (such as displaying a biometry icon), call [`checkBiometry`](#checkbiometry) and inspect the [`CheckBiometryResult`](#checkbiometryresult) to see what (if any) biometry is available on the device. Note that `isAvailable` may be `false` but `biometryType` may indicate the presence of biometry on the device. This occurs if the current user is not enrolled in biometry, or if biometry has been disabled for the current app. In such cases the `reason` and `code` will tell you why.
36
36
 
37
37
  Because the availability of biometry can change while your app is in the background, it’s important to check availability when your app resumes. By calling [`addResumeListener`](#addresumelistener) you can register a callback that is passed a [`CheckBiometryResult`](#checkbiometryresult) when your app resumes.
38
38
 
@@ -1,7 +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.1.3'
4
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
5
6
  }
6
7
 
7
8
  buildscript {
@@ -10,17 +11,18 @@ buildscript {
10
11
  mavenCentral()
11
12
  }
12
13
  dependencies {
13
- classpath 'com.android.tools.build:gradle:4.1.3'
14
+ classpath 'com.android.tools.build:gradle:8.0.2'
14
15
  }
15
16
  }
16
17
 
17
18
  apply plugin: 'com.android.library'
18
19
 
19
20
  android {
20
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
21
+ namespace "com.aparajita.capacitor.biometricauth"
22
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
21
23
  defaultConfig {
22
24
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
23
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
25
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
24
26
  versionCode 1
25
27
  versionName "1.0"
26
28
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -35,8 +37,8 @@ android {
35
37
  abortOnError false
36
38
  }
37
39
  compileOptions {
38
- sourceCompatibility JavaVersion.VERSION_11
39
- targetCompatibility JavaVersion.VERSION_11
40
+ sourceCompatibility JavaVersion.VERSION_17
41
+ targetCompatibility JavaVersion.VERSION_17
40
42
  }
41
43
  }
42
44
 
@@ -50,11 +52,11 @@ dependencies {
50
52
  implementation 'androidx.biometric:biometric:1.1.0'
51
53
  implementation fileTree(dir: 'libs', include: ['*.jar'])
52
54
  implementation project(':capacitor-android')
53
- implementation 'androidx.appcompat:appcompat:1.4.2'
54
- implementation 'com.google.android.material:material:1.6.1'
55
+ implementation 'androidx.appcompat:appcompat:1.6.1'
56
+ implementation 'com.google.android.material:material:1.9.0'
55
57
  implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
56
- implementation 'androidx.navigation:navigation-fragment:2.5.1'
57
- implementation 'androidx.navigation:navigation-ui:2.5.1'
58
+ implementation 'androidx.navigation:navigation-fragment:2.6.0'
59
+ implementation 'androidx.navigation:navigation-ui:2.6.0'
58
60
  testImplementation "junit:junit:$junitVersion"
59
61
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
60
62
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.aparajita.capacitor.biometricauth">
3
+ >
4
4
 
5
5
  <application>
6
6
  <activity
@@ -35,10 +35,6 @@ public class AuthActivity extends AppCompatActivity {
35
35
  String title = intent.getStringExtra(BiometricAuthNative.TITLE);
36
36
  String subtitle = intent.getStringExtra(BiometricAuthNative.SUBTITLE);
37
37
  String description = intent.getStringExtra(BiometricAuthNative.REASON);
38
- final int maxAttempts = intent.getIntExtra(
39
- BiometricAuthNative.MAX_ATTEMPTS,
40
- BiometricAuthNative.DEFAULT_MAX_ATTEMPTS
41
- );
42
38
  allowDeviceCredential = false;
43
39
 
44
40
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@@ -163,7 +163,7 @@ export interface CheckBiometryResult {
163
163
  /**
164
164
  * The signature of the callback passed to `addResumeListener()`.
165
165
  */
166
- export declare type ResumeListener = (info: CheckBiometryResult) => void;
166
+ export type ResumeListener = (info: CheckBiometryResult) => void;
167
167
  export interface BiometricAuthPlugin extends WebPlugin {
168
168
  /**
169
169
  * Check to see what biometry type (if any) is available.
package/dist/esm/index.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
- import info from './info.json';
3
- console.log(`loaded ${info.name} v${info.version}`);
4
2
  const proxy = registerPlugin('BiometricAuthNative', {
5
3
  web: async () => import('./web').then((module) => new module.BiometricAuthWeb()),
6
4
  ios: async () => import('./native').then((module) => new module.BiometricAuthNative(proxy)),
7
- android: async () => import('./native').then((module) => new module.BiometricAuthNative(proxy))
5
+ android: async () => import('./native').then((module) => new module.BiometricAuthNative(proxy)),
8
6
  });
9
7
  export * from './definitions';
10
8
  export * from './web-utils';
@@ -13,7 +13,7 @@ export class BiometricAuthNative extends BiometricAuthBase {
13
13
  isAvailable: true,
14
14
  biometryType: BiometryType.none,
15
15
  reason: '',
16
- code: BiometryErrorType.none
16
+ code: BiometryErrorType.none,
17
17
  });
18
18
  }
19
19
  // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
@@ -5,7 +5,7 @@ const kBiometryTypeNameMap = {
5
5
  [BiometryType.faceId]: 'Face ID',
6
6
  [BiometryType.fingerprintAuthentication]: 'Fingerprint Authentication',
7
7
  [BiometryType.faceAuthentication]: 'Face Authentication',
8
- [BiometryType.irisAuthentication]: 'Iris Authentication'
8
+ [BiometryType.irisAuthentication]: 'Iris Authentication',
9
9
  };
10
10
  /**
11
11
  * Return a human-readable name for a BiometryType.
package/dist/esm/web.js CHANGED
@@ -12,7 +12,7 @@ export class BiometricAuthWeb extends BiometricAuthBase {
12
12
  isAvailable: this.biometryType !== BiometryType.none,
13
13
  biometryType: this.biometryType,
14
14
  reason: '',
15
- code: BiometryErrorType.none
15
+ code: BiometryErrorType.none,
16
16
  });
17
17
  }
18
18
  async authenticate(options) {
@@ -3,11 +3,6 @@
3
3
  var core = require('@capacitor/core');
4
4
  var app = require('@capacitor/app');
5
5
 
6
- var info = {
7
- name: "@aparajita/capacitor-biometric-auth",
8
- version: "4.0.0"
9
- };
10
-
11
6
  exports.BiometryType = void 0;
12
7
  (function (BiometryType) {
13
8
  /**
@@ -72,7 +67,7 @@ const kBiometryTypeNameMap = {
72
67
  [exports.BiometryType.faceId]: 'Face ID',
73
68
  [exports.BiometryType.fingerprintAuthentication]: 'Fingerprint Authentication',
74
69
  [exports.BiometryType.faceAuthentication]: 'Face Authentication',
75
- [exports.BiometryType.irisAuthentication]: 'Iris Authentication'
70
+ [exports.BiometryType.irisAuthentication]: 'Iris Authentication',
76
71
  };
77
72
  /**
78
73
  * Return a human-readable name for a BiometryType.
@@ -82,11 +77,10 @@ function getBiometryName(type) {
82
77
  return kBiometryTypeNameMap[type] || '';
83
78
  }
84
79
 
85
- console.log(`loaded ${info.name} v${info.version}`);
86
80
  const proxy = core.registerPlugin('BiometricAuthNative', {
87
81
  web: async () => Promise.resolve().then(function () { return web; }).then((module) => new module.BiometricAuthWeb()),
88
82
  ios: async () => Promise.resolve().then(function () { return native; }).then((module) => new module.BiometricAuthNative(proxy)),
89
- android: async () => Promise.resolve().then(function () { return native; }).then((module) => new module.BiometricAuthNative(proxy))
83
+ android: async () => Promise.resolve().then(function () { return native; }).then((module) => new module.BiometricAuthNative(proxy)),
90
84
  });
91
85
 
92
86
  // eslint-disable-next-line import/prefer-default-export
@@ -115,7 +109,7 @@ class BiometricAuthWeb extends BiometricAuthBase {
115
109
  isAvailable: this.biometryType !== exports.BiometryType.none,
116
110
  biometryType: this.biometryType,
117
111
  reason: '',
118
- code: exports.BiometryErrorType.none
112
+ code: exports.BiometryErrorType.none,
119
113
  });
120
114
  }
121
115
  async authenticate(options) {
@@ -168,7 +162,7 @@ class BiometricAuthNative extends BiometricAuthBase {
168
162
  isAvailable: true,
169
163
  biometryType: exports.BiometryType.none,
170
164
  reason: '',
171
- code: exports.BiometryErrorType.none
165
+ code: exports.BiometryErrorType.none,
172
166
  });
173
167
  }
174
168
  // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
package/dist/plugin.js CHANGED
@@ -1,11 +1,6 @@
1
1
  var capacitorBiometricAuth = (function (exports, core, app) {
2
2
  'use strict';
3
3
 
4
- var info = {
5
- name: "@aparajita/capacitor-biometric-auth",
6
- version: "4.0.0"
7
- };
8
-
9
4
  exports.BiometryType = void 0;
10
5
  (function (BiometryType) {
11
6
  /**
@@ -70,7 +65,7 @@ var capacitorBiometricAuth = (function (exports, core, app) {
70
65
  [exports.BiometryType.faceId]: 'Face ID',
71
66
  [exports.BiometryType.fingerprintAuthentication]: 'Fingerprint Authentication',
72
67
  [exports.BiometryType.faceAuthentication]: 'Face Authentication',
73
- [exports.BiometryType.irisAuthentication]: 'Iris Authentication'
68
+ [exports.BiometryType.irisAuthentication]: 'Iris Authentication',
74
69
  };
75
70
  /**
76
71
  * Return a human-readable name for a BiometryType.
@@ -80,11 +75,10 @@ var capacitorBiometricAuth = (function (exports, core, app) {
80
75
  return kBiometryTypeNameMap[type] || '';
81
76
  }
82
77
 
83
- console.log(`loaded ${info.name} v${info.version}`);
84
78
  const proxy = core.registerPlugin('BiometricAuthNative', {
85
79
  web: async () => Promise.resolve().then(function () { return web; }).then((module) => new module.BiometricAuthWeb()),
86
80
  ios: async () => Promise.resolve().then(function () { return native; }).then((module) => new module.BiometricAuthNative(proxy)),
87
- android: async () => Promise.resolve().then(function () { return native; }).then((module) => new module.BiometricAuthNative(proxy))
81
+ android: async () => Promise.resolve().then(function () { return native; }).then((module) => new module.BiometricAuthNative(proxy)),
88
82
  });
89
83
 
90
84
  // eslint-disable-next-line import/prefer-default-export
@@ -113,7 +107,7 @@ var capacitorBiometricAuth = (function (exports, core, app) {
113
107
  isAvailable: this.biometryType !== exports.BiometryType.none,
114
108
  biometryType: this.biometryType,
115
109
  reason: '',
116
- code: exports.BiometryErrorType.none
110
+ code: exports.BiometryErrorType.none,
117
111
  });
118
112
  }
119
113
  async authenticate(options) {
@@ -166,7 +160,7 @@ var capacitorBiometricAuth = (function (exports, core, app) {
166
160
  isAvailable: true,
167
161
  biometryType: exports.BiometryType.none,
168
162
  reason: '',
169
- code: exports.BiometryErrorType.none
163
+ code: exports.BiometryErrorType.none,
170
164
  });
171
165
  }
172
166
  // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-function
@@ -1,8 +1,6 @@
1
1
  #import <Foundation/Foundation.h>
2
2
  #import <Capacitor/Capacitor.h>
3
3
 
4
- // Generated by @aparajita/capacitor-native-decorator/make-ios-plugin
5
-
6
4
  CAP_PLUGIN(BiometricAuthNative, "BiometricAuthNative",
7
5
  CAP_PLUGIN_METHOD(checkBiometry, CAPPluginReturnPromise);
8
6
  CAP_PLUGIN_METHOD(authenticate, CAPPluginReturnPromise);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aparajita/capacitor-biometric-auth",
3
- "version": "4.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Provides access to the native biometric auth APIs for Capacitor apps",
5
5
  "author": "Aparajita Fishman",
6
6
  "license": "MIT",
@@ -56,46 +56,44 @@
56
56
  "@aparajita/eslint-config-base": "^1.1.5",
57
57
  "@aparajita/prettier-config": "^1.0.0",
58
58
  "@aparajita/swiftly": "^1.0.4",
59
- "@capacitor/cli": "^4.7.2",
60
- "@commitlint/cli": "^17.5.1",
61
- "@commitlint/config-conventional": "^17.4.4",
59
+ "@capacitor/cli": "^5.0.5",
60
+ "@commitlint/cli": "^17.6.5",
61
+ "@commitlint/config-conventional": "^17.6.5",
62
62
  "@ionic/swiftlint-config": "^1.1.2",
63
63
  "@rollup/plugin-json": "^6.0.0",
64
- "@types/node": "^18.15.11",
65
- "@typescript-eslint/eslint-plugin": "^5.57.0",
66
- "@typescript-eslint/parser": "^5.57.0",
67
- "commit-and-tag-version": "^11.2.0",
68
- "eslint": "^8.37.0",
64
+ "@types/node": "^20.3.1",
65
+ "@typescript-eslint/eslint-plugin": "^5.59.11",
66
+ "@typescript-eslint/parser": "^5.59.11",
67
+ "commit-and-tag-version": "^11.2.1",
68
+ "eslint": "^8.42.0",
69
69
  "eslint-config-prettier": "^8.8.0",
70
- "eslint-config-standard": "^17.0.0",
71
- "eslint-import-resolver-typescript": "^3.5.4",
70
+ "eslint-config-standard": "^17.1.0",
71
+ "eslint-import-resolver-typescript": "^3.5.5",
72
72
  "eslint-plugin-import": "^2.27.5",
73
- "eslint-plugin-n": "^15.7.0",
73
+ "eslint-plugin-n": "^16.0.0",
74
74
  "eslint-plugin-prettier": "^4.2.1",
75
75
  "eslint-plugin-promise": "^6.1.1",
76
- "husky": "^8.0.3",
77
76
  "nodemon": "^2.0.22",
78
- "prettier": "^2.8.7",
77
+ "prettier": "^2.8.8",
79
78
  "prettier-plugin-java": "^2.1.0",
80
- "rimraf": "^4.4.1",
81
- "rollup": "^3.20.2",
82
- "swiftlint": "^1.0.1",
83
- "typescript": "~4.7.4"
79
+ "rimraf": "^5.0.1",
80
+ "rollup": "^3.25.1",
81
+ "swiftlint": "^1.0.2",
82
+ "typescript": "~5.1.3"
84
83
  },
85
84
  "dependencies": {
86
- "@capacitor/android": "^4.7.2",
87
- "@capacitor/app": "^4.1.1",
88
- "@capacitor/core": "^4.7.2",
89
- "@capacitor/ios": "^4.7.2"
85
+ "@capacitor/android": "^5.0.5",
86
+ "@capacitor/app": "^5.0.3",
87
+ "@capacitor/core": "^5.0.5",
88
+ "@capacitor/ios": "^5.0.5"
90
89
  },
91
90
  "scripts": {
92
91
  "clean": "rimraf dist",
93
- "extract-info": "node scripts/extractPackageInfo.js",
94
92
  "lint.eslint": "eslint --fix --cache --ext .js,.cjs,.mjs,.ts --max-warnings 0",
95
93
  "lint.prettier": "prettier --write --cache --list-different",
96
94
  "lint.tsc": "tsc --noEmit",
97
95
  "lint": "pnpm lint.eslint . && pnpm lint.prettier . && pnpm lint.tsc",
98
- "prebuilder": "pnpm clean && pnpm extract-info",
96
+ "prebuilder": "pnpm clean",
99
97
  "builder": "tsc ${SOURCE_MAP:-} && rollup -c rollup.config.mjs",
100
98
  "prebuild": "pnpm lint",
101
99
  "build": "pnpm builder",
@@ -1,4 +0,0 @@
1
- {
2
- "name": "@aparajita/capacitor-biometric-auth",
3
- "version": "4.0.0"
4
- }