@aparajita/capacitor-biometric-auth 3.1.2 → 3.1.4
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 +3 -1
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/res/values/strings.xml +1 -10
- package/android/src/main/res/values/styles.xml +0 -6
- package/dist/esm/definitions.d.ts +7 -5
- package/dist/esm/info.json +1 -1
- package/dist/plugin.cjs.js +1 -1
- package/dist/plugin.js +1 -1
- package/ios/Plugin/Plugin.swift +0 -6
- package/package.json +1 -1
- package/android/src/main/res/layout/bridge_layout_main.xml +0 -15
- package/android/src/main/res/navigation/nav_graph.xml +0 -28
- package/android/src/main/res/values/colors.xml +0 -3
- package/android/src/main/res/values/dimens.xml +0 -3
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ Not using [pnpm](https://pnpm.js.org/)? You owe it to yourself to give it a try.
|
|
|
28
28
|
|
|
29
29
|
The API is extensively documented in the [TypeScript definitions file](src/definitions.ts). There is also (somewhat incomplete auto-generated) documentation [below](#api). For a complete example of how to use this plugin in practice, see the [demo app](https://github.com/aparajita/capacitor-biometric-auth-demo).
|
|
30
30
|
|
|
31
|
+
> **NOTE:** Your Android app must use a base theme named "AppTheme".
|
|
32
|
+
|
|
31
33
|
### Checking availability
|
|
32
34
|
|
|
33
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.
|
|
@@ -107,7 +109,7 @@ web only<br><br>On the web, this method allows you to dynamically simulate diffe
|
|
|
107
109
|
authenticate(options?: AuthenticateOptions) => Promise<void>
|
|
108
110
|
```
|
|
109
111
|
|
|
110
|
-
Prompt the user for authentication. If authorization fails for any reason, the promise is rejected with a `BiometryError`.<br><br>For detailed information about the behavior on iOS, see:<br><br>https://developer.apple.com/documentation/localauthentication/lapolicy/deviceownerauthenticationwithbiometrics<br><br>Android
|
|
112
|
+
Prompt the user for authentication. If authorization fails for any reason, the promise is rejected with a `BiometryError`.<br><br>For detailed information about the behavior on iOS, see:<br><br>https://developer.apple.com/documentation/localauthentication/lapolicy/deviceownerauthenticationwithbiometrics<br><br>Some versions of Android impose a limit on the number of failed attempts. If `allowDeviceCredential` is `true`, when the limit is reached the user will then be presented with a device credential prompt. If `allowDeviceCredential` is `false`, when the limit is reached `authenticate()` will reject with a `BiometryErrorType` of `biometryLockout`, after which the user will have to wait the system-defined length of time before being allowed to authenticate again.
|
|
111
113
|
|
|
112
114
|
| Param | Type |
|
|
113
115
|
| :------ | :----------------------------------------------------- |
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
<resources>
|
|
2
|
-
<string name="
|
|
3
|
-
<string name="title_activity_auth_acitivy">AuthAcitivy</string>
|
|
4
|
-
<!-- Strings used for fragments for navigation -->
|
|
5
|
-
<string name="first_fragment_label">First Fragment</string>
|
|
6
|
-
<string name="second_fragment_label">Second Fragment</string>
|
|
7
|
-
<string name="next">Next</string>
|
|
8
|
-
<string name="previous">Previous</string>
|
|
9
|
-
|
|
10
|
-
<string name="hello_first_fragment">Hello first fragment</string>
|
|
11
|
-
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
|
|
2
|
+
<string name="title_activity_auth_activity">AuthActivity</string>
|
|
12
3
|
</resources>
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
<resources>
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<style name="AppTheme.NoActionBar">
|
|
5
|
-
<item name="windowActionBar">false</item>
|
|
6
|
-
<item name="windowNoTitle">true</item>
|
|
7
|
-
</style>
|
|
8
|
-
|
|
9
3
|
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
|
10
4
|
|
|
11
5
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
|
@@ -173,11 +173,13 @@ export interface BiometricAuthPlugin extends WebPlugin {
|
|
|
173
173
|
*
|
|
174
174
|
* https://developer.apple.com/documentation/localauthentication/lapolicy/deviceownerauthenticationwithbiometrics
|
|
175
175
|
*
|
|
176
|
-
* Android
|
|
177
|
-
* `true`, the
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
176
|
+
* Some versions of Android impose a limit on the number of failed attempts.
|
|
177
|
+
* If `allowDeviceCredential` is `true`, when the limit is reached
|
|
178
|
+
* the user will then be presented with a device credential prompt.
|
|
179
|
+
* If `allowDeviceCredential` is `false`, when the limit is reached
|
|
180
|
+
* `authenticate()` will reject with a `BiometryErrorType` of `biometryLockout`,
|
|
181
|
+
* after which the user will have to wait the system-defined length of time
|
|
182
|
+
* before being allowed to authenticate again.
|
|
181
183
|
*
|
|
182
184
|
* @rejects {BiometryError}
|
|
183
185
|
*/
|
package/dist/esm/info.json
CHANGED
package/dist/plugin.cjs.js
CHANGED
package/dist/plugin.js
CHANGED
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -22,7 +22,6 @@ public class BiometricAuthNative: CAPPlugin {
|
|
|
22
22
|
]
|
|
23
23
|
|
|
24
24
|
var canEvaluatePolicy = true
|
|
25
|
-
var count = 0
|
|
26
25
|
|
|
27
26
|
/**
|
|
28
27
|
* Check the device's availability and type of biometric authentication.
|
|
@@ -61,11 +60,6 @@ public class BiometricAuthNative: CAPPlugin {
|
|
|
61
60
|
])
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
@objc func test(_ call: CAPPluginCall) {
|
|
65
|
-
call.resolve(["count": count])
|
|
66
|
-
count += 1
|
|
67
|
-
}
|
|
68
|
-
|
|
69
63
|
/**
|
|
70
64
|
* Prompt the user for authentication.
|
|
71
65
|
*
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
-
android:layout_width="match_parent"
|
|
6
|
-
android:layout_height="match_parent"
|
|
7
|
-
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
-
>
|
|
9
|
-
|
|
10
|
-
<WebView
|
|
11
|
-
android:id="@+id/webview"
|
|
12
|
-
android:layout_width="fill_parent"
|
|
13
|
-
android:layout_height="fill_parent" />
|
|
14
|
-
|
|
15
|
-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
-
android:id="@+id/nav_graph"
|
|
6
|
-
app:startDestination="@id/FirstFragment">
|
|
7
|
-
|
|
8
|
-
<fragment
|
|
9
|
-
android:id="@+id/FirstFragment"
|
|
10
|
-
android:name="com.epicshaggy.biometric.FirstFragment"
|
|
11
|
-
android:label="@string/first_fragment_label"
|
|
12
|
-
tools:layout="@layout/fragment_first">
|
|
13
|
-
|
|
14
|
-
<action
|
|
15
|
-
android:id="@+id/action_FirstFragment_to_SecondFragment"
|
|
16
|
-
app:destination="@id/SecondFragment" />
|
|
17
|
-
</fragment>
|
|
18
|
-
<fragment
|
|
19
|
-
android:id="@+id/SecondFragment"
|
|
20
|
-
android:name="com.epicshaggy.biometric.SecondFragment"
|
|
21
|
-
android:label="@string/second_fragment_label"
|
|
22
|
-
tools:layout="@layout/fragment_second">
|
|
23
|
-
|
|
24
|
-
<action
|
|
25
|
-
android:id="@+id/action_SecondFragment_to_FirstFragment"
|
|
26
|
-
app:destination="@id/FirstFragment" />
|
|
27
|
-
</fragment>
|
|
28
|
-
</navigation>
|