@microblink/blinkid-react-native 7.6.0 → 7.6.2
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 +7 -4
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/microblink/blinkid/reactnative/BlinkidReactNativeModule.kt +50 -53
- package/ios/BlinkIdSerializationUtilities.swift +1 -0
- package/ios/BlinkidReactNative.h +10 -2
- package/ios/BlinkidReactNative.mm +62 -48
- package/ios/Frameworks/BlinkID.xcframework/Info.plist +5 -5
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/BlinkID +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Headers/BlinkID-Swift.h +19 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Info.plist +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios.abi.json +40 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios.swiftinterface +1 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/_CodeSignature/CodeResources +15 -15
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/conan.xcconfig +3 -3
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/BlinkID +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Headers/BlinkID-Swift.h +38 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Info.plist +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios-simulator.abi.json +40 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/x86_64-apple-ios-simulator.abi.json +40 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/Modules/BlinkID.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -0
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/_CodeSignature/CodeResources +25 -25
- package/ios/Frameworks/BlinkID.xcframework/ios-arm64_x86_64-simulator/BlinkID.framework/conan.xcconfig +3 -3
- package/ios/Frameworks/BlinkIDUX.xcframework/Info.plist +5 -5
- package/ios/Frameworks/BlinkIDUX.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/_CodeSignature/CodeResources +81 -81
- package/ios/Frameworks/BlinkIDUX.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/BlinkIDUX +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/Assets.car +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/Info.plist +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/Info.plist +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios.abi.json +261 -139
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios.package.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios.private.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/BlinkIDUX +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/Assets.car +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/Info.plist +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/_CodeSignature/CodeDirectory +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/BlinkIDUX_BlinkIDUX.bundle/_CodeSignature/CodeResources +3 -3
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Info.plist +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios-simulator.abi.json +261 -139
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios-simulator.package.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/arm64-apple-ios-simulator.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/x86_64-apple-ios-simulator.abi.json +261 -139
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/x86_64-apple-ios-simulator.package.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/Modules/BlinkIDUX.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +26 -2
- package/ios/Frameworks/BlinkIDUX.xcframework/ios-arm64_x86_64-simulator/BlinkIDUX.framework/_CodeSignature/CodeResources +1 -1
- package/lib/module/NativeBlinkidReactNative.js +2 -1
- package/lib/module/NativeBlinkidReactNative.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +12 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/NativeBlinkidReactNative.d.ts +2 -2
- package/lib/typescript/src/NativeBlinkidReactNative.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +11 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeBlinkidReactNative.ts +4 -1
- package/src/index.tsx +9 -1
- package/src/types.ts +13 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.project +0 -28
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ A valid license key is required to initialize the BlinkID plugin. A free trial l
|
|
|
32
32
|
## <a name="requirements"></a> Requirements
|
|
33
33
|
|
|
34
34
|
- BlinkID React Native was built and tested with [React Native v0.82.1](https://github.com/facebook/react-native/releases/tag/v0.82.1)
|
|
35
|
+
- The BlinkID React Native SDK is also compatible with React Native applications running on the old architecture as it contains backward compatibility with Native Module implementation.
|
|
35
36
|
- For additional help with React-Native setup, view the official documentation [here](https://reactnative.dev/docs/set-up-your-environment).
|
|
36
37
|
|
|
37
38
|
**Device requirements**
|
|
@@ -181,9 +182,11 @@ import {
|
|
|
181
182
|
* Modify the BlinkID UI settings for UI customization.
|
|
182
183
|
* This parameter is optional.
|
|
183
184
|
*/
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
const blinkIdScanningUxSettings = new BlinkIdScanningUxSettings();
|
|
186
|
+
blinkIdScanningUxSettings.showHelpButton = true;
|
|
187
|
+
blinkIdScanningUxSettings.showOnboardingDialog = true;
|
|
188
|
+
blinkIdScanningUxSettings.allowHapticFeedback = true;
|
|
189
|
+
blinkIdScanningUxSettings.preferredCamera = PreferredCamera.Back;
|
|
187
190
|
|
|
188
191
|
/**
|
|
189
192
|
* Add the document class filter. This parameter is optional.
|
|
@@ -204,7 +207,7 @@ import {
|
|
|
204
207
|
* Here, you can also pass the optional BlinkIdUiSettings and ClassFilter
|
|
205
208
|
* parameters.
|
|
206
209
|
*/
|
|
207
|
-
await performScan(sdkSettings, sessionSettings,
|
|
210
|
+
await performScan(sdkSettings, sessionSettings, blinkIdScanningUxSettings)
|
|
208
211
|
.then((result: BlinkIdScanningResult) => {
|
|
209
212
|
// handle the results here.
|
|
210
213
|
console.log(result.firstName?.value);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Tue Dec 09 11:51:57 CET 2025
|
|
2
2
|
gradle.version=8.9
|
package/android/build.gradle
CHANGED
|
@@ -75,7 +75,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
|
75
75
|
dependencies {
|
|
76
76
|
implementation "com.facebook.react:react-android"
|
|
77
77
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
78
|
-
implementation("com.microblink:blinkid-ux:7.6.
|
|
78
|
+
implementation("com.microblink:blinkid-ux:7.6.1")
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
react {
|
package/android/src/main/java/com/microblink/blinkid/reactnative/BlinkidReactNativeModule.kt
CHANGED
|
@@ -8,11 +8,11 @@ import com.facebook.react.bridge.Promise
|
|
|
8
8
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
9
9
|
import com.facebook.react.module.annotations.ReactModule
|
|
10
10
|
import com.microblink.blinkid.core.BlinkIdSdk
|
|
11
|
+
import com.microblink.blinkid.core.BlinkIdSdkSettings
|
|
11
12
|
import com.microblink.blinkid.core.session.BlinkIdProcessResult
|
|
12
13
|
import com.microblink.blinkid.ux.contract.BlinkIdScanActivityResultStatus
|
|
13
14
|
import com.microblink.blinkid.ux.contract.BlinkIdScanActivitySettings
|
|
14
15
|
import com.microblink.blinkid.ux.contract.MbBlinkIdScan
|
|
15
|
-
import com.microblink.core.LicenseLockedException
|
|
16
16
|
import com.microblink.core.image.InputImage
|
|
17
17
|
import com.microblink.core.ping.PingManager
|
|
18
18
|
import com.microblink.core.ping.pinglets.WrapperProductInfo
|
|
@@ -20,14 +20,13 @@ import kotlinx.coroutines.CoroutineScope
|
|
|
20
20
|
import kotlinx.coroutines.Dispatchers
|
|
21
21
|
import kotlinx.coroutines.launch
|
|
22
22
|
import kotlinx.coroutines.withContext
|
|
23
|
-
import okhttp3.Dispatcher
|
|
24
23
|
import org.json.JSONObject
|
|
25
24
|
|
|
26
25
|
@ReactModule(name = BlinkidReactNativeModule.NAME)
|
|
27
26
|
class BlinkidReactNativeModule(reactContext: ReactApplicationContext) :
|
|
28
27
|
NativeBlinkidReactNativeSpec(reactContext) {
|
|
29
28
|
private val BLINKID_REQUEST_CODE = 1453
|
|
30
|
-
private val BLINKID_ERROR_RESULT_CODE = "
|
|
29
|
+
private val BLINKID_ERROR_RESULT_CODE = "BlinkIdAndroidError"
|
|
31
30
|
var pendingPromise: Promise? = null
|
|
32
31
|
private var blinkIdSdk: BlinkIdSdk? = null
|
|
33
32
|
|
|
@@ -47,14 +46,7 @@ class BlinkidReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
47
46
|
pendingPromise?.resolve("")
|
|
48
47
|
} catch (error: Exception) {
|
|
49
48
|
blinkIdSdk = null
|
|
50
|
-
|
|
51
|
-
is LicenseLockedException -> {
|
|
52
|
-
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, error.message)
|
|
53
|
-
}
|
|
54
|
-
else -> {
|
|
55
|
-
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, error.message)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
49
|
+
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, error.message)
|
|
58
50
|
}
|
|
59
51
|
}
|
|
60
52
|
}
|
|
@@ -97,13 +89,16 @@ class BlinkidReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
97
89
|
scanningResult
|
|
98
90
|
)
|
|
99
91
|
pendingPromise?.resolve(success)
|
|
100
|
-
|
|
92
|
+
blinkIdSdk = null
|
|
101
93
|
} ?: pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, "BlinkID result is empty.")
|
|
102
94
|
}
|
|
103
95
|
|
|
104
96
|
BlinkIdScanActivityResultStatus.Canceled -> {
|
|
105
97
|
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, "Scanning is canceled.")
|
|
106
|
-
|
|
98
|
+
blinkIdSdk = null
|
|
99
|
+
suspend {
|
|
100
|
+
BlinkIdSdk.sdkInstance?.close()
|
|
101
|
+
}
|
|
107
102
|
}
|
|
108
103
|
|
|
109
104
|
BlinkIdScanActivityResultStatus.ErrorSdkInit -> {
|
|
@@ -111,6 +106,10 @@ class BlinkidReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
111
106
|
BLINKID_ERROR_RESULT_CODE,
|
|
112
107
|
"Could not initialize the SDK."
|
|
113
108
|
)
|
|
109
|
+
blinkIdSdk = null
|
|
110
|
+
suspend {
|
|
111
|
+
BlinkIdSdk.sdkInstance?.close()
|
|
112
|
+
}
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
115
|
}
|
|
@@ -125,48 +124,44 @@ class BlinkidReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
125
124
|
classFilter: String?,
|
|
126
125
|
promise: Promise?
|
|
127
126
|
) {
|
|
128
|
-
|
|
127
|
+
CoroutineScope(Dispatchers.Main).launch {
|
|
128
|
+
pendingPromise = promise
|
|
129
|
+
try {
|
|
130
|
+
val sdkSettingsJson = blinkIdSdkSettings?.let { JSONObject(it) }
|
|
131
|
+
val sessionSettingsJson = blinkIdSessionSettings?.let { JSONObject(it) }
|
|
132
|
+
val classFilterJson = classFilter?.let { JSONObject(it) }
|
|
133
|
+
val blinkIdScanningUxJson = blinkIdScanningUxSettings?.let { JSONObject(it) }
|
|
134
|
+
val sdkSettings: BlinkIdSdkSettings = sdkSettingsJson?.let {
|
|
135
|
+
BlinkIdDeserializationUtilities.deserializeBlinkIdSdkSettings(it)
|
|
136
|
+
}?:return@launch withContext(Dispatchers.Main) {
|
|
137
|
+
promise?.reject(BLINKID_ERROR_RESULT_CODE, "Invalid SDK settings")
|
|
138
|
+
}
|
|
129
139
|
|
|
130
|
-
|
|
131
|
-
val sdkSettingsJson = blinkIdSdkSettings?.let { JSONObject(it) }
|
|
132
|
-
val sessionSettingsJson = blinkIdSessionSettings?.let { JSONObject(it) }
|
|
133
|
-
val classFilterJson = classFilter?.let { JSONObject(it) }
|
|
134
|
-
val blinkIdScanningUxJson = blinkIdScanningUxSettings?.let { JSONObject(it) }
|
|
135
|
-
val sdkSettings = sdkSettingsJson?.let {
|
|
136
|
-
BlinkIdDeserializationUtilities.deserializeBlinkIdSdkSettings(it)
|
|
137
|
-
} ?: run {
|
|
138
|
-
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, "Invalid SDK settings.")
|
|
139
|
-
return
|
|
140
|
-
}
|
|
140
|
+
blinkIdSdk = ensureLoadedSdk(sdkSettingsJson)
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
142
|
+
reactApplicationContext.currentActivity?.applicationContext?.let {
|
|
143
|
+
val intent = MbBlinkIdScan().createIntent(
|
|
144
|
+
it,
|
|
145
|
+
BlinkIdScanActivitySettings(
|
|
146
|
+
sdkSettings = sdkSettings,
|
|
147
|
+
cameraSettings = BlinkIdDeserializationUtilities.deserializeCameraSettings(blinkIdScanningUxJson),
|
|
148
|
+
scanningSessionSettings = BlinkIdDeserializationUtilities.deserializeBlinkIdSessionSettings(
|
|
149
|
+
sessionSettingsJson,
|
|
150
|
+
false
|
|
151
|
+
),
|
|
152
|
+
uxSettings = BlinkIdDeserializationUtilities.deserializeBlinkIdScanningUxSettings(
|
|
153
|
+
blinkIdScanningUxJson,
|
|
154
|
+
classFilterJson,
|
|
155
|
+
),
|
|
156
|
+
showHelpButton = blinkIdScanningUxJson?.optBoolean("showHelpButton", true)?: true,
|
|
157
|
+
showOnboardingDialog = blinkIdScanningUxJson?.optBoolean("showOnboardingDialog", true) ?: true
|
|
158
|
+
)
|
|
158
159
|
)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
when (error) {
|
|
165
|
-
is LicenseLockedException -> {
|
|
166
|
-
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, error.message)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
else -> {
|
|
160
|
+
addReactNativePinglet(it)
|
|
161
|
+
reactApplicationContext.startActivityForResult(intent, BLINKID_REQUEST_CODE, null)
|
|
162
|
+
} ?: run { pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, "Activity not found.")}
|
|
163
|
+
} catch (error: Exception) {
|
|
164
|
+
run {
|
|
170
165
|
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, error.message)
|
|
171
166
|
}
|
|
172
167
|
}
|
|
@@ -227,7 +222,9 @@ class BlinkidReactNativeModule(reactContext: ReactApplicationContext) :
|
|
|
227
222
|
|
|
228
223
|
it.close()
|
|
229
224
|
blinkIdSdk = null
|
|
230
|
-
}?:
|
|
225
|
+
}?: return@launch withContext(Dispatchers.Main) {
|
|
226
|
+
pendingPromise?.reject(BLINKID_ERROR_RESULT_CODE, "Reason: The BlinkID SDK is not initialized. Call the loadBlinkIdSdk() method to pre-load the SDK first, or try running the performDirectApiScan() method with a valid internet connection.", null)
|
|
227
|
+
}
|
|
231
228
|
} catch (e: Exception) {
|
|
232
229
|
withContext(Dispatchers.Main) {
|
|
233
230
|
promise?.reject(BLINKID_ERROR_RESULT_CODE, e.message)
|
|
@@ -493,6 +493,7 @@ class BlinkIdSerializationUtilities {
|
|
|
493
493
|
"weightKilograms": elements?.getValue(for: .weightKilograms),
|
|
494
494
|
"weightPounds": elements?.getValue(for: .weightPounds),
|
|
495
495
|
"weightRange": elements?.getValue(for: .weightRange),
|
|
496
|
+
"subFieldDesignator": elements?.getValue(for: .subfieldDesignator)
|
|
496
497
|
]
|
|
497
498
|
return barcodeElementDict.compactMapValues { $0 }
|
|
498
499
|
}
|
package/ios/BlinkidReactNative.h
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
#import <React/RCTEventEmitter.h>
|
|
3
|
+
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
1
5
|
#import <BlinkidReactNativeSpec/BlinkidReactNativeSpec.h>
|
|
6
|
+
#endif
|
|
2
7
|
|
|
3
|
-
@interface BlinkidReactNative :
|
|
4
|
-
|
|
8
|
+
@interface BlinkidReactNative : RCTEventEmitter <RCTBridgeModule>
|
|
9
|
+
@end
|
|
5
10
|
|
|
11
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
12
|
+
@interface BlinkidReactNative () <NativeBlinkidReactNativeSpec>
|
|
6
13
|
@end
|
|
14
|
+
#endif
|
|
@@ -1,40 +1,55 @@
|
|
|
1
1
|
#import "BlinkidReactNative.h"
|
|
2
2
|
#import "BlinkidReactNative-Swift.h"
|
|
3
3
|
|
|
4
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
5
|
+
#import <BlinkidReactNativeSpec/BlinkidReactNativeSpec.h>
|
|
6
|
+
#endif
|
|
7
|
+
|
|
4
8
|
@implementation BlinkidReactNative {
|
|
5
|
-
|
|
9
|
+
BlinkidReactNativeModule *moduleImplementation;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
|
-
-(instancetype)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
- (instancetype)init
|
|
13
|
+
{
|
|
14
|
+
if (self = [super init]) {
|
|
15
|
+
moduleImplementation = [BlinkidReactNativeModule new];
|
|
16
|
+
}
|
|
17
|
+
return self;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
RCT_EXPORT_MODULE()
|
|
20
|
+
RCT_EXPORT_MODULE(BlinkidReactNative);
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
(
|
|
22
|
+
RCT_EXPORT_METHOD(loadBlinkIdSdk:(NSString *)blinkIdSdkSettings
|
|
23
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
24
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
20
25
|
{
|
|
21
|
-
|
|
26
|
+
[self->moduleImplementation loadSdk: [self createDictionaryFromBlinkIdObject:blinkIdSdkSettings] onResolve:^(NSString * _Nonnull) {
|
|
27
|
+
resolve(@"");
|
|
28
|
+
} onReject:^(NSString * _Nonnull error) {
|
|
29
|
+
reject(@"BlinkIdIosError", error, nil);
|
|
30
|
+
}];
|
|
22
31
|
}
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
RCT_EXPORT_METHOD(unloadBlinkIdSdk:(BOOL)deleteCachedResources
|
|
34
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
35
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
36
|
+
{
|
|
37
|
+
[self->moduleImplementation
|
|
38
|
+
unloadSdk:deleteCachedResources
|
|
39
|
+
onResolve:^(NSString * _Nonnull) {
|
|
40
|
+
resolve(@"");
|
|
41
|
+
} onReject:^(NSString * _Nonnull error) {
|
|
42
|
+
reject(@"BlinkIdIosError", error, nil);
|
|
43
|
+
}];
|
|
34
44
|
}
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
RCT_EXPORT_METHOD(performScan:(NSString *)blinkIdSdkSettings
|
|
47
|
+
blinkIdSessionSettings:(NSString *)blinkIdSessionSettings
|
|
48
|
+
blinkIdScanningUxSettings:(NSString *)blinkIdScanningUxSettings
|
|
49
|
+
classFilter:(NSString *)classFilter
|
|
50
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
51
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
52
|
+
{
|
|
38
53
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
39
54
|
UIWindow *keyWindow = nil;
|
|
40
55
|
|
|
@@ -67,8 +82,13 @@ RCT_EXPORT_MODULE()
|
|
|
67
82
|
});
|
|
68
83
|
}
|
|
69
84
|
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
RCT_EXPORT_METHOD(performDirectApiScan:(NSString *)blinkIdSdkSettings
|
|
86
|
+
blinkIdSessionSettings:(NSString *)blinkIdSessionSettings
|
|
87
|
+
firstImage:(NSString *)firstImage
|
|
88
|
+
secondImage:(NSString *)secondImage
|
|
89
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
90
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
91
|
+
{
|
|
72
92
|
[self->moduleImplementation
|
|
73
93
|
performDirectApiScanWithBlinkIdSdkSettings: [self createDictionaryFromBlinkIdObject: blinkIdSdkSettings]
|
|
74
94
|
blinkIdSessionSettings: [self createDictionaryFromBlinkIdObject: blinkIdSessionSettings]
|
|
@@ -81,32 +101,26 @@ RCT_EXPORT_MODULE()
|
|
|
81
101
|
}];
|
|
82
102
|
}
|
|
83
103
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}];
|
|
104
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
105
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
106
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
107
|
+
{
|
|
108
|
+
return std::make_shared<facebook::react::NativeBlinkidReactNativeSpecJSI>(params);
|
|
90
109
|
}
|
|
110
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
91
111
|
|
|
112
|
+
- (NSDictionary *)createDictionaryFromBlinkIdObject:(NSString *)jsonString
|
|
113
|
+
{
|
|
114
|
+
NSError *jsonError;
|
|
115
|
+
NSData *data = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
|
116
|
+
if (!data) {
|
|
117
|
+
return nil;
|
|
118
|
+
}
|
|
92
119
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
reject(@"BlinkIdIosError", error, nil);
|
|
98
|
-
}];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
- (NSDictionary *)createDictionaryFromBlinkIdObject:(NSString *)jsonString {
|
|
102
|
-
NSError *jsonError;
|
|
103
|
-
NSData *data = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
|
|
104
|
-
if (!data) return nil;
|
|
105
|
-
|
|
106
|
-
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data
|
|
107
|
-
options:NSJSONReadingMutableContainers
|
|
108
|
-
error:&jsonError];
|
|
109
|
-
return dict;
|
|
120
|
+
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data
|
|
121
|
+
options:NSJSONReadingMutableContainers
|
|
122
|
+
error:&jsonError];
|
|
123
|
+
return dict;
|
|
110
124
|
}
|
|
111
125
|
|
|
112
126
|
@end
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>BlinkID.framework/BlinkID</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>BlinkID.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
+
<string>x86_64</string>
|
|
17
18
|
</array>
|
|
18
19
|
<key>SupportedPlatform</key>
|
|
19
20
|
<string>ios</string>
|
|
21
|
+
<key>SupportedPlatformVariant</key>
|
|
22
|
+
<string>simulator</string>
|
|
20
23
|
</dict>
|
|
21
24
|
<dict>
|
|
22
25
|
<key>BinaryPath</key>
|
|
23
26
|
<string>BlinkID.framework/BlinkID</string>
|
|
24
27
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
28
|
+
<string>ios-arm64</string>
|
|
26
29
|
<key>LibraryPath</key>
|
|
27
30
|
<string>BlinkID.framework</string>
|
|
28
31
|
<key>SupportedArchitectures</key>
|
|
29
32
|
<array>
|
|
30
33
|
<string>arm64</string>
|
|
31
|
-
<string>x86_64</string>
|
|
32
34
|
</array>
|
|
33
35
|
<key>SupportedPlatform</key>
|
|
34
36
|
<string>ios</string>
|
|
35
|
-
<key>SupportedPlatformVariant</key>
|
|
36
|
-
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
package/ios/Frameworks/BlinkID.xcframework/ios-arm64/BlinkID.framework/Headers/BlinkID-Swift.h
CHANGED
|
@@ -5794,6 +5794,7 @@ extern unsigned $s7BlinkID17BarcodeElementKeyO17dataDiscriminatoryA2CmFWC;
|
|
|
5794
5794
|
extern unsigned $s7BlinkID17BarcodeElementKeyO23documentExpirationMonthyA2CmFWC;
|
|
5795
5795
|
extern unsigned $s7BlinkID17BarcodeElementKeyO19documentNonexpiringyA2CmFWC;
|
|
5796
5796
|
extern unsigned $s7BlinkID17BarcodeElementKeyO15securityVersionyA2CmFWC;
|
|
5797
|
+
extern unsigned $s7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmFWC;
|
|
5797
5798
|
}
|
|
5798
5799
|
|
|
5799
5800
|
} // namespace _impl
|
|
@@ -5926,6 +5927,7 @@ public:
|
|
|
5926
5927
|
documentExpirationMonth SWIFT_SYMBOL("s:7BlinkID17BarcodeElementKeyO23documentExpirationMonthyA2CmF"),
|
|
5927
5928
|
documentNonexpiring SWIFT_SYMBOL("s:7BlinkID17BarcodeElementKeyO19documentNonexpiringyA2CmF"),
|
|
5928
5929
|
securityVersion SWIFT_SYMBOL("s:7BlinkID17BarcodeElementKeyO15securityVersionyA2CmF"),
|
|
5930
|
+
subfieldDesignator SWIFT_SYMBOL("s:7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmF"),
|
|
5929
5931
|
unknownDefault
|
|
5930
5932
|
};
|
|
5931
5933
|
|
|
@@ -6619,6 +6621,14 @@ public:
|
|
|
6619
6621
|
} securityVersion SWIFT_SYMBOL("s:7BlinkID17BarcodeElementKeyO15securityVersionyA2CmF");
|
|
6620
6622
|
SWIFT_INLINE_THUNK bool isSecurityVersion() const;
|
|
6621
6623
|
|
|
6624
|
+
inline const static struct _impl_subfieldDesignator { // impl struct for case subfieldDesignator
|
|
6625
|
+
SWIFT_INLINE_THUNK constexpr operator cases() const {
|
|
6626
|
+
return cases::subfieldDesignator;
|
|
6627
|
+
}
|
|
6628
|
+
SWIFT_INLINE_THUNK BarcodeElementKey operator()() const;
|
|
6629
|
+
} subfieldDesignator SWIFT_SYMBOL("s:7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmF");
|
|
6630
|
+
SWIFT_INLINE_THUNK bool isSubfieldDesignator() const;
|
|
6631
|
+
|
|
6622
6632
|
inline const static struct _impl_unknownDefault { // impl struct for case unknownDefault
|
|
6623
6633
|
SWIFT_INLINE_THUNK constexpr operator cases() const {
|
|
6624
6634
|
return cases::unknownDefault;
|
|
@@ -6715,6 +6725,7 @@ public:
|
|
|
6715
6725
|
if (tag == _impl::$s7BlinkID17BarcodeElementKeyO23documentExpirationMonthyA2CmFWC) return cases::documentExpirationMonth;
|
|
6716
6726
|
if (tag == _impl::$s7BlinkID17BarcodeElementKeyO19documentNonexpiringyA2CmFWC) return cases::documentNonexpiring;
|
|
6717
6727
|
if (tag == _impl::$s7BlinkID17BarcodeElementKeyO15securityVersionyA2CmFWC) return cases::securityVersion;
|
|
6728
|
+
if (tag == _impl::$s7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmFWC) return cases::subfieldDesignator;
|
|
6718
6729
|
return cases::unknownDefault;
|
|
6719
6730
|
}
|
|
6720
6731
|
|
|
@@ -33574,6 +33585,14 @@ namespace BlinkID SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("BlinkID") {
|
|
|
33574
33585
|
SWIFT_INLINE_THUNK bool BarcodeElementKey::isSecurityVersion() const {
|
|
33575
33586
|
return *this == BarcodeElementKey::securityVersion;
|
|
33576
33587
|
}
|
|
33588
|
+
SWIFT_INLINE_THUNK BarcodeElementKey BarcodeElementKey::_impl_subfieldDesignator::operator()() const {
|
|
33589
|
+
auto result = BarcodeElementKey::_make();
|
|
33590
|
+
result._destructiveInjectEnumTag(_impl::$s7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmFWC);
|
|
33591
|
+
return result;
|
|
33592
|
+
}
|
|
33593
|
+
SWIFT_INLINE_THUNK bool BarcodeElementKey::isSubfieldDesignator() const {
|
|
33594
|
+
return *this == BarcodeElementKey::subfieldDesignator;
|
|
33595
|
+
}
|
|
33577
33596
|
SWIFT_INLINE_THUNK bool BarcodeElementKey::isUnknownDefault() const {
|
|
33578
33597
|
return *this == BarcodeElementKey::unknownDefault;
|
|
33579
33598
|
}
|
|
Binary file
|
|
@@ -65629,6 +65629,46 @@
|
|
|
65629
65629
|
"RawDocComment"
|
|
65630
65630
|
]
|
|
65631
65631
|
},
|
|
65632
|
+
{
|
|
65633
|
+
"kind": "Var",
|
|
65634
|
+
"name": "subfieldDesignator",
|
|
65635
|
+
"printedName": "subfieldDesignator",
|
|
65636
|
+
"children": [
|
|
65637
|
+
{
|
|
65638
|
+
"kind": "TypeFunc",
|
|
65639
|
+
"name": "Function",
|
|
65640
|
+
"printedName": "(BlinkID.BarcodeElementKey.Type) -> BlinkID.BarcodeElementKey",
|
|
65641
|
+
"children": [
|
|
65642
|
+
{
|
|
65643
|
+
"kind": "TypeNominal",
|
|
65644
|
+
"name": "BarcodeElementKey",
|
|
65645
|
+
"printedName": "BlinkID.BarcodeElementKey",
|
|
65646
|
+
"usr": "s:7BlinkID17BarcodeElementKeyO"
|
|
65647
|
+
},
|
|
65648
|
+
{
|
|
65649
|
+
"kind": "TypeNominal",
|
|
65650
|
+
"name": "Metatype",
|
|
65651
|
+
"printedName": "BlinkID.BarcodeElementKey.Type",
|
|
65652
|
+
"children": [
|
|
65653
|
+
{
|
|
65654
|
+
"kind": "TypeNominal",
|
|
65655
|
+
"name": "BarcodeElementKey",
|
|
65656
|
+
"printedName": "BlinkID.BarcodeElementKey",
|
|
65657
|
+
"usr": "s:7BlinkID17BarcodeElementKeyO"
|
|
65658
|
+
}
|
|
65659
|
+
]
|
|
65660
|
+
}
|
|
65661
|
+
]
|
|
65662
|
+
}
|
|
65663
|
+
],
|
|
65664
|
+
"declKind": "EnumElement",
|
|
65665
|
+
"usr": "s:7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmF",
|
|
65666
|
+
"mangledName": "$s7BlinkID17BarcodeElementKeyO18subfieldDesignatoryA2CmF",
|
|
65667
|
+
"moduleName": "BlinkID",
|
|
65668
|
+
"declAttributes": [
|
|
65669
|
+
"RawDocComment"
|
|
65670
|
+
]
|
|
65671
|
+
},
|
|
65632
65672
|
{
|
|
65633
65673
|
"kind": "Function",
|
|
65634
65674
|
"name": "==",
|
|
@@ -1840,6 +1840,7 @@ public enum BarcodeElementKey {
|
|
|
1840
1840
|
case documentExpirationMonth
|
|
1841
1841
|
case documentNonexpiring
|
|
1842
1842
|
case securityVersion
|
|
1843
|
+
case subfieldDesignator
|
|
1843
1844
|
public static func == (a: BlinkID.BarcodeElementKey, b: BlinkID.BarcodeElementKey) -> Swift.Bool
|
|
1844
1845
|
public func hash(into hasher: inout Swift.Hasher)
|
|
1845
1846
|
public var hashValue: Swift.Int {
|
|
Binary file
|
|
@@ -1840,6 +1840,7 @@ public enum BarcodeElementKey {
|
|
|
1840
1840
|
case documentExpirationMonth
|
|
1841
1841
|
case documentNonexpiring
|
|
1842
1842
|
case securityVersion
|
|
1843
|
+
case subfieldDesignator
|
|
1843
1844
|
public static func == (a: BlinkID.BarcodeElementKey, b: BlinkID.BarcodeElementKey) -> Swift.Bool
|
|
1844
1845
|
public func hash(into hasher: inout Swift.Hasher)
|
|
1845
1846
|
public var hashValue: Swift.Int {
|