react-native-usesense 2.3.3 → 2.3.5
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 +14 -27
- package/android/build.gradle +1 -1
- package/ios/UseSenseModule.m +21 -12
- package/package.json +2 -8
package/README.md
CHANGED
|
@@ -74,44 +74,31 @@ Add required permissions to your `AndroidManifest.xml`:
|
|
|
74
74
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
**
|
|
78
|
-
registration
|
|
79
|
-
|
|
77
|
+
**One Gradle setting is required** (auto-linking handles module
|
|
78
|
+
registration). The native SDK requires Android API 28 — set it in your
|
|
79
|
+
app's `android/build.gradle`:
|
|
80
80
|
|
|
81
81
|
```groovy
|
|
82
|
-
// 1. The native SDK requires Android API 28.
|
|
83
82
|
ext {
|
|
84
83
|
minSdkVersion = 28
|
|
85
84
|
}
|
|
86
|
-
|
|
87
|
-
// 2. The SDK is built with Kotlin 2.2; React Native's Kotlin 1.9
|
|
88
|
-
// toolchain can't read 2.2 metadata. Force kotlin-stdlib to a
|
|
89
|
-
// 1.9-readable version. (Not needed once RN ships Kotlin >= 2.2.)
|
|
90
|
-
allprojects {
|
|
91
|
-
configurations.all {
|
|
92
|
-
resolutionStrategy.eachDependency {
|
|
93
|
-
if (requested.group == 'org.jetbrains.kotlin' &&
|
|
94
|
-
requested.name.startsWith('kotlin-stdlib')) {
|
|
95
|
-
useVersion '2.0.21'
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
85
|
```
|
|
101
86
|
|
|
102
|
-
Without
|
|
103
|
-
(`minSdkVersion … cannot be smaller than 28`)
|
|
104
|
-
(`Class 'kotlin.Unit' was compiled with an incompatible version`).
|
|
87
|
+
Without it, a release build fails at manifest merge
|
|
88
|
+
(`minSdkVersion … cannot be smaller than 28`).
|
|
105
89
|
|
|
106
90
|
### New Architecture
|
|
107
91
|
|
|
108
|
-
|
|
109
|
-
|
|
92
|
+
The plugin works on **both** the New Architecture and the Old (Bridge)
|
|
93
|
+
Architecture, with no configuration difference. It's a native bridge
|
|
94
|
+
module, and RN's built-in legacy interop layer (on by default since RN
|
|
95
|
+
0.74) runs it transparently under the New Architecture — you don't need
|
|
96
|
+
to enable or change anything.
|
|
110
97
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
98
|
+
CI verifies both paths on every change: one job builds a release APK on
|
|
99
|
+
the Old Architecture, another builds a fresh RN app with the New
|
|
100
|
+
Architecture enabled. (It is not a native TurboModule — that migration
|
|
101
|
+
isn't required for New-Arch support and isn't currently planned.)
|
|
115
102
|
|
|
116
103
|
## Quick start
|
|
117
104
|
|
package/android/build.gradle
CHANGED
|
@@ -44,7 +44,7 @@ dependencies {
|
|
|
44
44
|
// the iOS SDK 4.3.0 the plugin's podspec depends on). mavenCentral()
|
|
45
45
|
// is already in the `repositories` block above, so no custom
|
|
46
46
|
// repository declaration is needed.
|
|
47
|
-
implementation "ai.usesense:sdk:4.6.
|
|
47
|
+
implementation "ai.usesense:sdk:4.6.4"
|
|
48
48
|
|
|
49
49
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:${safeExtGet('kotlinVersion', '2.0.0')}"
|
|
50
50
|
}
|
package/ios/UseSenseModule.m
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
#import <React/RCTBridgeModule.h>
|
|
2
2
|
#import <React/RCTEventEmitter.h>
|
|
3
3
|
|
|
4
|
+
// Objective-C bridge declarations for the Swift `UseSenseModule` (an
|
|
5
|
+
// RCTEventEmitter). Each RCT_EXTERN_METHOD selector MUST match a Swift @objc
|
|
6
|
+
// method signature exactly, or the method is not exposed to JS.
|
|
7
|
+
//
|
|
8
|
+
// This file previously drifted from the Swift: it declared startSession /
|
|
9
|
+
// cancelSession / getSessionStatus / subscribeToEvents / unsubscribeFromEvents /
|
|
10
|
+
// getSdkVersion (none of which exist in UseSenseModule.swift) and OMITTED the
|
|
11
|
+
// methods JS actually calls (startVerification / reset / isInitialized), plus
|
|
12
|
+
// declared `initialize` without its resolver/rejecter. The result was that
|
|
13
|
+
// `UseSense.startVerification()` / `reset()` / `isInitialized()` silently failed
|
|
14
|
+
// on iOS. These declarations now mirror the Swift 1:1.
|
|
15
|
+
//
|
|
16
|
+
// addListener:/removeListeners: are provided by RCTEventEmitter itself and are
|
|
17
|
+
// intentionally not declared here.
|
|
4
18
|
@interface RCT_EXTERN_MODULE(UseSenseModule, RCTEventEmitter)
|
|
5
19
|
|
|
6
|
-
RCT_EXTERN_METHOD(initialize:(NSDictionary *)config
|
|
7
|
-
|
|
8
|
-
RCT_EXTERN_METHOD(startSession:(NSDictionary *)options
|
|
20
|
+
RCT_EXTERN_METHOD(initialize:(NSDictionary *)config
|
|
9
21
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
10
22
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
11
23
|
|
|
12
|
-
RCT_EXTERN_METHOD(
|
|
13
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
14
|
-
|
|
15
|
-
RCT_EXTERN_METHOD(getSessionStatus:(NSString *)sessionId
|
|
24
|
+
RCT_EXTERN_METHOD(startVerification:(NSDictionary *)request
|
|
16
25
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
17
26
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
18
27
|
|
|
19
|
-
RCT_EXTERN_METHOD(subscribeToEvents)
|
|
20
|
-
|
|
21
|
-
RCT_EXTERN_METHOD(unsubscribeFromEvents)
|
|
22
|
-
|
|
23
28
|
// LiveSense v4 passthrough (R-1)
|
|
24
29
|
RCT_EXTERN_METHOD(startV4Verification:(NSDictionary *)request
|
|
25
30
|
resolver:(RCTPromiseResolveBlock)resolve
|
|
26
31
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
27
32
|
|
|
28
|
-
RCT_EXTERN_METHOD(
|
|
33
|
+
RCT_EXTERN_METHOD(reset:(RCTPromiseResolveBlock)resolve
|
|
34
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
35
|
+
|
|
36
|
+
RCT_EXTERN_METHOD(isInitialized:(RCTPromiseResolveBlock)resolve
|
|
37
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
29
38
|
|
|
30
39
|
@end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-usesense",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "React Native plugin for human presence verification. Wraps the native UseSense iOS and Android SDKs.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -39,8 +39,7 @@
|
|
|
39
39
|
"biometric",
|
|
40
40
|
"face-verification",
|
|
41
41
|
"deepfake-detection",
|
|
42
|
-
"presence-verification"
|
|
43
|
-
"turbo-module"
|
|
42
|
+
"presence-verification"
|
|
44
43
|
],
|
|
45
44
|
"repository": {
|
|
46
45
|
"type": "git",
|
|
@@ -73,11 +72,6 @@
|
|
|
73
72
|
"ts-jest": "^29.4.11",
|
|
74
73
|
"typescript": "^5.3.0"
|
|
75
74
|
},
|
|
76
|
-
"codegenConfig": {
|
|
77
|
-
"name": "RNUseSenseSpec",
|
|
78
|
-
"type": "modules",
|
|
79
|
-
"jsSrcsDir": "src"
|
|
80
|
-
},
|
|
81
75
|
"react-native-builder-bob": {
|
|
82
76
|
"source": "src",
|
|
83
77
|
"output": "lib",
|