@onekeyfe/react-native-check-biometric-auth-changed 3.0.162-alpha.272 → 3.0.163
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 +49 -0
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @onekeyfe/react-native-check-biometric-auth-changed
|
|
2
|
+
|
|
3
|
+
Detect changes to the stored biometric authentication domain state on iOS.
|
|
4
|
+
OneKey uses this native signal to decide whether previously accepted biometric
|
|
5
|
+
state needs to be reconsidered. The package reports a change; the application
|
|
6
|
+
owns any authentication prompt and its subsequent security policy.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
yarn add @onekeyfe/react-native-check-biometric-auth-changed react-native-nitro-modules
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Install the application's iOS pods and rebuild the native application after
|
|
15
|
+
adding the package. The exported function requires its Nitro native module.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { checkBiometricAuthChanged } from '@onekeyfe/react-native-check-biometric-auth-changed';
|
|
21
|
+
|
|
22
|
+
const changed = await checkBiometricAuthChanged();
|
|
23
|
+
if (changed) {
|
|
24
|
+
// Apply the application's existing biometric re-enrollment policy.
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Platform behavior
|
|
29
|
+
|
|
30
|
+
- iOS reads LocalAuthentication's evaluated policy domain state and compares it
|
|
31
|
+
with the previous value stored in Keychain. A check with available state
|
|
32
|
+
stores that state as the baseline for subsequent calls.
|
|
33
|
+
- The first available state establishes a baseline unless legacy stored state
|
|
34
|
+
exists. A missing current domain state returns `false`.
|
|
35
|
+
- Android currently returns `false` from a stub implementation. It does not
|
|
36
|
+
detect enrollment changes.
|
|
37
|
+
|
|
38
|
+
A `false` result is not proof that biometrics are available or that the user has
|
|
39
|
+
authenticated: it can also mean no comparison was possible. This API does not
|
|
40
|
+
replace an authentication challenge, and has no Web implementation.
|
|
41
|
+
|
|
42
|
+
The wrapper is in [src/index.tsx](src/index.tsx); its native interface is
|
|
43
|
+
[src/ReactNativeCheckBiometricAuthChanged.nitro.ts](src/ReactNativeCheckBiometricAuthChanged.nitro.ts).
|
|
44
|
+
Review the platform sources when integrating this signal into an authentication
|
|
45
|
+
workflow.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
MIT.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-check-biometric-auth-changed",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.163",
|
|
4
|
+
"description": "Detect stored biometric authentication state changes on iOS",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -50,14 +50,15 @@
|
|
|
50
50
|
],
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
53
|
-
"url": "git+https://github.com/OneKeyHQ/app-modules
|
|
53
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|
|
54
|
+
"directory": "native-modules/react-native-check-biometric-auth-changed"
|
|
54
55
|
},
|
|
55
56
|
"author": "@onekeyfeonekeyfe <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules/react-native-check-biometric-auth-changed)",
|
|
56
57
|
"license": "MIT",
|
|
57
58
|
"bugs": {
|
|
58
|
-
"url": "https://github.com/OneKeyHQ/app-modules/
|
|
59
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
59
60
|
},
|
|
60
|
-
"homepage": "https://github.com/OneKeyHQ/app-modules/
|
|
61
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-check-biometric-auth-changed#readme",
|
|
61
62
|
"publishConfig": {
|
|
62
63
|
"registry": "https://registry.npmjs.org/"
|
|
63
64
|
},
|