assentify-sdk-react-native 1.0.0-Beta.21 → 1.0.0-Beta.23
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/Package.swift +172 -0
- package/README.md +11 -32
- package/android/build.gradle +1 -6
- package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +8 -5
- package/android/src/main/java/com/assentifysdk/FlowActivity.kt +5 -5
- package/ios/AssentifySdkBaseModule.swift +1 -0
- package/ios/NativeAssentifySdk.mm +2 -1
- package/ios/NativeAssentifySdk.swift +18 -13
- package/ios/UIComponents/RNPassportScanner.swift +4 -3
- package/ios/View/AssentifySdkEventEmitting.swift +10 -0
- package/ios/View/DataDecoder.swift +16 -16
- package/ios/View/FaceMatchController.swift +51 -51
- package/ios/View/IDCardController.swift +37 -37
- package/ios/View/OtherController.swift +33 -33
- package/ios/View/PassportController.swift +36 -36
- package/ios/View/QrController.swift +10 -10
- package/ios/View/UI.swift +77 -26
- package/lib/commonjs/AssentifyProvider.js +3 -0
- package/lib/commonjs/AssentifyProvider.js.map +1 -1
- package/lib/commonjs/AssentifyWrapper.js +4 -4
- package/lib/commonjs/AssentifyWrapper.js.map +1 -1
- package/lib/commonjs/Language.js +5 -1
- package/lib/commonjs/Language.js.map +1 -1
- package/lib/module/AssentifyProvider.js +4 -0
- package/lib/module/AssentifyProvider.js.map +1 -1
- package/lib/module/AssentifyWrapper.js +4 -4
- package/lib/module/AssentifyWrapper.js.map +1 -1
- package/lib/module/Language.js +4 -0
- package/lib/module/Language.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +0 -1
- package/lib/typescript/example/babel.config.d.ts +7 -4
- package/lib/typescript/example/babel.config.d.ts.map +1 -1
- package/lib/typescript/example/metro.config.d.ts +9 -1
- package/lib/typescript/example/metro.config.d.ts.map +1 -1
- package/lib/typescript/example/react-native.config.d.ts +5 -2
- package/lib/typescript/example/react-native.config.d.ts.map +1 -1
- package/lib/typescript/example/src/App.d.ts.map +1 -1
- package/lib/typescript/example/src/Home.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +2 -2
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Language.d.ts +6 -0
- package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts +2 -2
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/module/Language.d.ts +6 -0
- package/lib/typescript/lib/module/index.d.ts +2 -2
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyWrapper.d.ts +3 -2
- package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/src/Language.d.ts +5 -0
- package/lib/typescript/src/Language.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/package.json +9 -8
- package/src/AssentifyProvider.tsx +341 -305
- package/src/AssentifyWrapper.ts +7 -4
- package/src/Language.ts +7 -0
- package/assentify-sdk.podspec +0 -44
- package/lib/typescript/example/src/navigator.d.ts +0 -4
- package/lib/typescript/example/src/navigator.d.ts.map +0 -1
package/Package.swift
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// swift-tools-version: 6.0
|
|
2
|
+
// Root SPM manifest for assentify-sdk-react-native, consumed by RN 0.87+'s
|
|
3
|
+
// `npx react-native spm` autolinking (dep root registered via
|
|
4
|
+
// example/react-native.config.js; a real app registers it via its own
|
|
5
|
+
// node_modules install instead).
|
|
6
|
+
//
|
|
7
|
+
// Three build targets:
|
|
8
|
+
// - AssentifySdkReactNative (Swift): ios/View/** + ios/Resources. Zero
|
|
9
|
+
// React dependency -- talks to the bridge layer only through the
|
|
10
|
+
// AssentifySdkEventEmitting protocol (ios/View/AssentifySdkEventEmitting.swift).
|
|
11
|
+
// Ships as plain source in this same package graph (not a precompiled
|
|
12
|
+
// xcframework/binaryTarget -- that was tried first, but a binaryTarget
|
|
13
|
+
// whose public API exposes another SPM package's types (AssentifySdk)
|
|
14
|
+
// bakes in a module reference from its OWN isolated build/resolution
|
|
15
|
+
// graph, which doesn't resolve when a consuming app's SEPARATE SPM
|
|
16
|
+
// resolution tries to use it ("module 'AssentifySdk' not found" scanning
|
|
17
|
+
// the framework's generated header). Shipping as source means AssentifySdk
|
|
18
|
+
// resolves exactly once, consistently, for the whole app graph.
|
|
19
|
+
// - AssentifySdkReactNativeBridge (Swift): NativeAssentifySdk.swift,
|
|
20
|
+
// RNPassportScanner.swift, AssentifySdkBaseModule.swift. These subclass
|
|
21
|
+
// RCTEventEmitter/RCTViewManager directly, so they need RCTEventEmitter's
|
|
22
|
+
// ObjC interface visible at compile time -- `import React` (the module
|
|
23
|
+
// name the ReactHeaders target's custom module map declares) below.
|
|
24
|
+
// - AssentifySdkReactNativeObjC (Objective-C++): NativeAssentifySdk.mm,
|
|
25
|
+
// RNPassportScanner.m, RNIOSProgressBar.*, RNTMapManager.*. These use
|
|
26
|
+
// RCT_EXTERN_MODULE, which forward-declares the bridge module by name and
|
|
27
|
+
// resolves the Swift implementation via the Objective-C runtime at
|
|
28
|
+
// startup -- there is no compile-time symbol reference between this
|
|
29
|
+
// target and the Swift ones, so neither depends on the other; both just
|
|
30
|
+
// need to end up linked into the same product.
|
|
31
|
+
//
|
|
32
|
+
// Split into three (rather than the podspec's single mixed-language pod
|
|
33
|
+
// target) because SPM cannot compile Swift + Objective-C/C++ in one target.
|
|
34
|
+
import PackageDescription
|
|
35
|
+
|
|
36
|
+
let package = Package(
|
|
37
|
+
name: "AssentifySdkReactNative",
|
|
38
|
+
// Must be >= the upstream AssentifySdk.iOS.SPM engine's own minimum
|
|
39
|
+
// (16.0) -- SPM rejects a target claiming a lower floor than a product
|
|
40
|
+
// it depends on. NOTE: RN 0.87's autolinking aggregator
|
|
41
|
+
// (generate-spm-autolinking.js) currently hardcodes iOS 15 for EVERY
|
|
42
|
+
// autolinked package with no way to raise it per-dependency, so an app
|
|
43
|
+
// consuming this library via `npx react-native spm` will need that
|
|
44
|
+
// upstream limitation fixed/configurable before this resolves cleanly
|
|
45
|
+
// end-to-end; verified locally by patching the generated aggregator.
|
|
46
|
+
platforms: [.iOS(.v16)],
|
|
47
|
+
products: [
|
|
48
|
+
.library(
|
|
49
|
+
name: "AssentifySdkReactNative",
|
|
50
|
+
targets: [
|
|
51
|
+
"AssentifySdkReactNative",
|
|
52
|
+
"AssentifySdkReactNativeBridge",
|
|
53
|
+
"AssentifySdkReactNativeObjC",
|
|
54
|
+
]
|
|
55
|
+
),
|
|
56
|
+
],
|
|
57
|
+
dependencies: [
|
|
58
|
+
// RN 0.87+'s SPM app-side pipeline materializes this locally at
|
|
59
|
+
// <appRoot>/build/xcframeworks; a self-managed dep's relative
|
|
60
|
+
// .package(path:) is resolved against the autolinker's
|
|
61
|
+
// <appRoot>/build/generated/autolinking/libs/<SwiftName> symlink, not
|
|
62
|
+
// this file's real location -- both live under <appRoot>/build, so
|
|
63
|
+
// the "../../../../" depth is fixed by that RN-tooling convention
|
|
64
|
+
// regardless of which app consumes this package.
|
|
65
|
+
.package(name: "ReactNative", path: "../../../../xcframeworks"),
|
|
66
|
+
.package(name: "React-GeneratedCode", path: "../../../../generated/ios"),
|
|
67
|
+
.package(
|
|
68
|
+
url: "https://github.com/AssentifyLTD/Assentify.SDK.iOS.SPM.git",
|
|
69
|
+
exact: "1.0.0-Beta.19"
|
|
70
|
+
),
|
|
71
|
+
],
|
|
72
|
+
targets: [
|
|
73
|
+
.target(
|
|
74
|
+
name: "AssentifySdkReactNative",
|
|
75
|
+
dependencies: [
|
|
76
|
+
.product(name: "AssentifySdk", package: "assentify.sdk.ios.spm"),
|
|
77
|
+
],
|
|
78
|
+
path: "ios",
|
|
79
|
+
sources: [
|
|
80
|
+
"View/AssentifySdkEventEmitting.swift",
|
|
81
|
+
"View/DataDecoder.swift",
|
|
82
|
+
"View/FaceMatchController.swift",
|
|
83
|
+
"View/IDCardController.swift",
|
|
84
|
+
"View/OtherController.swift",
|
|
85
|
+
"View/PassportController.swift",
|
|
86
|
+
"View/QrController.swift",
|
|
87
|
+
"View/UI.swift",
|
|
88
|
+
],
|
|
89
|
+
// Individually-listed (not `.copy("Resources")`) so the files land
|
|
90
|
+
// flat at the resource bundle's root -- a nested top-level dir
|
|
91
|
+
// literally named "Resources" alongside the bundle's own Info.plist
|
|
92
|
+
// makes Xcode's codesign misidentify the bundle as a malformed
|
|
93
|
+
// macOS Contents/Resources layout ("bundle format unrecognized,
|
|
94
|
+
// invalid, or unsuitable"), failing CodeSign at build time.
|
|
95
|
+
resources: [
|
|
96
|
+
.copy("Resources/card.gif"),
|
|
97
|
+
.copy("Resources/expire.png"),
|
|
98
|
+
.copy("Resources/id.gif"),
|
|
99
|
+
.copy("Resources/id_warning.png"),
|
|
100
|
+
.copy("Resources/info_icon.png"),
|
|
101
|
+
.copy("Resources/passport.gif"),
|
|
102
|
+
.copy("Resources/sending.png"),
|
|
103
|
+
.copy("Resources/warning.png"),
|
|
104
|
+
.copy("Resources/zoom_in.png"),
|
|
105
|
+
.copy("Resources/zoom_out.png"),
|
|
106
|
+
],
|
|
107
|
+
// See the Bridge target below: this source predates Swift 6's
|
|
108
|
+
// strict concurrency checking (main-actor isolation wasn't a
|
|
109
|
+
// compile error under the podspec's Swift 5).
|
|
110
|
+
swiftSettings: [.swiftLanguageMode(.v5)]
|
|
111
|
+
),
|
|
112
|
+
.target(
|
|
113
|
+
name: "AssentifySdkReactNativeBridge",
|
|
114
|
+
dependencies: [
|
|
115
|
+
"AssentifySdkReactNative",
|
|
116
|
+
.product(name: "AssentifySdk", package: "assentify.sdk.ios.spm"),
|
|
117
|
+
.product(name: "ReactHeaders", package: "ReactNative"),
|
|
118
|
+
.product(name: "ReactNativeHeaders", package: "ReactNative"),
|
|
119
|
+
.product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"),
|
|
120
|
+
.product(name: "ReactAppHeaders", package: "React-GeneratedCode"),
|
|
121
|
+
],
|
|
122
|
+
path: "ios",
|
|
123
|
+
sources: [
|
|
124
|
+
"AssentifySdkBaseModule.swift",
|
|
125
|
+
"NativeAssentifySdk.swift",
|
|
126
|
+
"UIComponents/RNPassportScanner.swift",
|
|
127
|
+
],
|
|
128
|
+
// Matches the podspec's `swift_versions` (5.0-5.5): this source
|
|
129
|
+
// predates Swift 6 mode, which turns some existing syntax (e.g.
|
|
130
|
+
// `@objc (Name)` with a space) into hard errors instead of warnings.
|
|
131
|
+
swiftSettings: [.swiftLanguageMode(.v5)]
|
|
132
|
+
),
|
|
133
|
+
.target(
|
|
134
|
+
name: "AssentifySdkReactNativeObjC",
|
|
135
|
+
dependencies: [
|
|
136
|
+
// RCT_EXTERN_MODULE (NativeAssentifySdk.mm, RNPassportScanner.m)
|
|
137
|
+
// resolves NativeAssentifySdk/RNPassportScanner purely via the
|
|
138
|
+
// Objective-C runtime at startup -- no #import ever references
|
|
139
|
+
// the Bridge target, so nothing here creates a compile-time
|
|
140
|
+
// symbol reference to it. Without an explicit target
|
|
141
|
+
// dependency, Xcode's SPM integration doesn't guarantee this
|
|
142
|
+
// product's sibling targets all get linked into a consumer:
|
|
143
|
+
// observed in practice as this target's object linking fine
|
|
144
|
+
// while AssentifySdkReactNativeBridge's compiled Swift classes
|
|
145
|
+
// (which define those @objc names) silently drop out of the
|
|
146
|
+
// final link ("Undefined symbols: _OBJC_CLASS_$_NativeAssentifySdk").
|
|
147
|
+
// This dependency exists only to force that link edge.
|
|
148
|
+
"AssentifySdkReactNativeBridge",
|
|
149
|
+
.product(name: "ReactHeaders", package: "ReactNative"),
|
|
150
|
+
.product(name: "ReactNativeHeaders", package: "ReactNative"),
|
|
151
|
+
.product(name: "ReactNativeDependenciesHeaders", package: "ReactNative"),
|
|
152
|
+
.product(name: "ReactAppHeaders", package: "React-GeneratedCode"),
|
|
153
|
+
],
|
|
154
|
+
path: "ios",
|
|
155
|
+
sources: [
|
|
156
|
+
"NativeAssentifySdk.mm",
|
|
157
|
+
"UIComponents/RNPassportScanner.m",
|
|
158
|
+
"UIComponents/RNIOSProgressBar.m",
|
|
159
|
+
"UIComponents/RNTMapManager.m",
|
|
160
|
+
],
|
|
161
|
+
publicHeadersPath: "UIComponents",
|
|
162
|
+
cxxSettings: [
|
|
163
|
+
.define("DEBUG", .when(configuration: .debug)),
|
|
164
|
+
.define("NDEBUG", .when(configuration: .release)),
|
|
165
|
+
],
|
|
166
|
+
linkerSettings: [
|
|
167
|
+
.linkedFramework("MapKit"),
|
|
168
|
+
]
|
|
169
|
+
),
|
|
170
|
+
],
|
|
171
|
+
cxxLanguageStandard: .cxx20
|
|
172
|
+
)
|
package/README.md
CHANGED
|
@@ -56,43 +56,22 @@ yarn add assentify-sdk-react-native
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Installation iOS
|
|
59
|
-
**Podfile**
|
|
60
|
-
```
|
|
61
|
-
platform :ios, '18.0'
|
|
62
|
-
dynamic_frameworks = ['AssentifySdk', 'TensorFlowLiteSwift']
|
|
63
|
-
|
|
64
|
-
permissions_path = '../node_modules/react-native-permissions/ios'
|
|
65
|
-
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
|
|
66
|
-
|
|
67
|
-
pod 'SVGKit', :git => 'https://github.com/jbagaresgaray/SVGKit.git', :branch => '3.x', :modular_headers => true
|
|
68
|
-
pod 'CocoaLumberjack', :modular_headers => true
|
|
69
|
-
pod 'TensorFlowLiteSwift', '2.7.0' // If needed
|
|
70
|
-
use_frameworks!
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
pre_install do |installer|
|
|
74
|
-
installer.pod_targets.each do |pod|
|
|
75
|
-
if !dynamic_frameworks.include?(pod.name)
|
|
76
|
-
puts "Overriding the static_framework? method for #{pod.name}"
|
|
77
|
-
def pod.static_framework?;
|
|
78
|
-
true
|
|
79
|
-
end
|
|
80
|
-
def pod.build_type;
|
|
81
|
-
Pod::BuildType.static_library
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
59
|
|
|
87
|
-
|
|
60
|
+
As of this version, the underlying [AssentifySdk](https://github.com/AssentifyLTD/Assentify.SDK.iOS.SPM) native library is
|
|
61
|
+
distributed via **Swift Package Manager** instead of CocoaPods. You don't need to add it to your Podfile or install it
|
|
62
|
+
manually — the `assentify-sdk` pod declares it as an SPM dependency, and `pod install` wires the Swift package into your
|
|
63
|
+
Xcode project automatically (using React Native's built-in `spm_dependency`/autolinking support).
|
|
88
64
|
|
|
89
|
-
```swift
|
|
90
|
-
cd ios
|
|
91
|
-
pod install
|
|
92
|
-
```
|
|
93
65
|
|
|
94
66
|
## Versions
|
|
95
67
|
|
|
68
|
+
***1.0.0-Beta.23***
|
|
69
|
+
1. *iOS: Switched from CocoaPods to Swift Package Manager (SPM) for dependency management.*
|
|
70
|
+
|
|
71
|
+
***1.0.0-Beta.22***
|
|
72
|
+
1. *Added full RTL (Right-to-Left) and LTR (Left-to-Right) , Arabic and English layout support.*
|
|
73
|
+
2. *Enhanced the slider click animation*
|
|
74
|
+
|
|
96
75
|
***1.0.0-Beta.21***
|
|
97
76
|
1. "Assisted Data Entry Step" Improvements
|
|
98
77
|
|
package/android/build.gradle
CHANGED
|
@@ -23,7 +23,6 @@ def isNewArchitectureEnabled() {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
apply plugin: "com.android.library"
|
|
26
|
-
apply plugin: "kotlin-android"
|
|
27
26
|
|
|
28
27
|
def getExtOrDefault(name) {
|
|
29
28
|
return rootProject.ext.has(name)
|
|
@@ -79,10 +78,6 @@ android {
|
|
|
79
78
|
targetCompatibility JavaVersion.VERSION_17
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
kotlinOptions {
|
|
83
|
-
jvmTarget = "17"
|
|
84
|
-
}
|
|
85
|
-
|
|
86
81
|
packagingOptions {
|
|
87
82
|
pickFirst '**/libc++_shared.so'
|
|
88
83
|
pickFirst '**/libfbjni.so'
|
|
@@ -101,7 +96,7 @@ dependencies {
|
|
|
101
96
|
compileOnly("com.facebook.react:react-android")
|
|
102
97
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
103
98
|
|
|
104
|
-
implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:1.0.0-Beta.
|
|
99
|
+
implementation 'com.github.AssentifyLTD:Assentify.SDK.Android:1.0.0-Beta.33'
|
|
105
100
|
|
|
106
101
|
implementation 'com.google.code.gson:gson:2.13.2'
|
|
107
102
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.9.7'
|
|
@@ -77,8 +77,8 @@ class AssentifySdkModule(context: ReactApplicationContext) :
|
|
|
77
77
|
iOSMinRam:Int = 2,
|
|
78
78
|
minCPUCores:Int = 6,
|
|
79
79
|
manualClickColor: String? = null,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
countDownNumbersColor: String? = null,
|
|
81
|
+
flowUiLanguage: String? = null
|
|
82
82
|
|
|
83
83
|
) {
|
|
84
84
|
try {
|
|
@@ -117,6 +117,7 @@ class AssentifySdkModule(context: ReactApplicationContext) :
|
|
|
117
117
|
println("$tag MinCPUCores: $minCPUCores")
|
|
118
118
|
println("$tag ManualClickColor: $manualClickColor")
|
|
119
119
|
println("$tag countDownNumbersColor: $countDownNumbersColor")
|
|
120
|
+
println("$tag flowUiLanguage: $flowUiLanguage")
|
|
120
121
|
println("$tag ==============================================")
|
|
121
122
|
|
|
122
123
|
val typeActive: ActiveLiveType = when (activeLiveType) {
|
|
@@ -140,7 +141,9 @@ class AssentifySdkModule(context: ReactApplicationContext) :
|
|
|
140
141
|
activeLivenessCheckCount = activeLivenessCheckCount,
|
|
141
142
|
faceLivenessRetryCount = faceLivenessRetryCount ,
|
|
142
143
|
minRam = minRam,
|
|
143
|
-
minCPUCores = minCPUCores
|
|
144
|
+
minCPUCores = minCPUCores,
|
|
145
|
+
flowUiLanguage = flowUiLanguage ?: "en",
|
|
146
|
+
|
|
144
147
|
)
|
|
145
148
|
|
|
146
149
|
val eventResultMap = Arguments.createMap().apply {
|
|
@@ -507,7 +510,7 @@ class AssentifySdkModule(context: ReactApplicationContext) :
|
|
|
507
510
|
holdUntilClickColors: Double? = null,
|
|
508
511
|
backgroundType: String? = null,
|
|
509
512
|
clear: Boolean? = null,
|
|
510
|
-
|
|
513
|
+
extractedDataLanguage: String,
|
|
511
514
|
enableNfc: Boolean? = null,
|
|
512
515
|
enableQr: Boolean? = null,
|
|
513
516
|
jsonBlockLoaderCustomProperties: String? = null,
|
|
@@ -539,7 +542,7 @@ class AssentifySdkModule(context: ReactApplicationContext) :
|
|
|
539
542
|
)
|
|
540
543
|
intent.putExtra("angleDegreesClickColors", angleDegreesClickColors)
|
|
541
544
|
intent.putExtra("holdUntilClickColors", holdUntilClickColors)
|
|
542
|
-
intent.putExtra("
|
|
545
|
+
intent.putExtra("extractedDataLanguage", extractedDataLanguage)
|
|
543
546
|
intent.putExtra("enableNfc", enableNfc)
|
|
544
547
|
intent.putExtra("enableQr", enableQr)
|
|
545
548
|
intent.putExtra("jsonBlockLoaderCustomProperties", jsonBlockLoaderCustomProperties)
|
|
@@ -27,7 +27,7 @@ class FlowActivity : AppCompatActivity() , FlowCallBack {
|
|
|
27
27
|
private lateinit var reactApplicationContext: ReactApplicationContext
|
|
28
28
|
private lateinit var assentifySdk: AssentifySdk
|
|
29
29
|
|
|
30
|
-
private lateinit var
|
|
30
|
+
private lateinit var extractedDataLanguage: String;
|
|
31
31
|
private var enableNfc: Boolean = false;
|
|
32
32
|
private var enableQr: Boolean = false;
|
|
33
33
|
private var blockLoaderCustomProperties: Map<String, Any> = emptyMap()
|
|
@@ -71,8 +71,8 @@ class FlowActivity : AppCompatActivity() , FlowCallBack {
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
intent.getStringExtra("
|
|
74
|
+
extractedDataLanguage =
|
|
75
|
+
intent.getStringExtra("extractedDataLanguage") ?: extractedDataLanguage
|
|
76
76
|
|
|
77
77
|
enableNfc = intent.getBooleanExtra("enableNfc", false)
|
|
78
78
|
enableQr = intent.getBooleanExtra("enableQr", false)
|
|
@@ -107,7 +107,7 @@ class FlowActivity : AppCompatActivity() , FlowCallBack {
|
|
|
107
107
|
Log.d("FlowActivity", "angleDegreesClickColors: $angleDegreesClickColors")
|
|
108
108
|
Log.d("FlowActivity", "holdUntilClickColors: $holdUntilClickColors")
|
|
109
109
|
|
|
110
|
-
Log.d("FlowActivity", "
|
|
110
|
+
Log.d("FlowActivity", "extractedDataLanguage: $extractedDataLanguage")
|
|
111
111
|
Log.d("FlowActivity", "enableNfc: $enableNfc")
|
|
112
112
|
Log.d("FlowActivity", "enableQr: $enableQr")
|
|
113
113
|
Log.d("FlowActivity", "blockLoaderCustomProperties: $blockLoaderCustomProperties")
|
|
@@ -169,7 +169,7 @@ class FlowActivity : AppCompatActivity() , FlowCallBack {
|
|
|
169
169
|
backgroundType = bType,
|
|
170
170
|
backgroundColor = backgroundColor,
|
|
171
171
|
clickColor = clickColor,
|
|
172
|
-
|
|
172
|
+
extractedDataLanguage = extractedDataLanguage,
|
|
173
173
|
enableNfc = enableNfc,
|
|
174
174
|
enableQr = enableQr,
|
|
175
175
|
blockLoaderCustomProperties = blockLoaderCustomProperties,
|
|
@@ -25,6 +25,7 @@ RCT_EXTERN_METHOD(initialize: (NSString *)apiKey
|
|
|
25
25
|
minCPUCores:(nonnull NSNumber * )minCPUCores
|
|
26
26
|
manualClickColor:(NSString * )manualClickColor
|
|
27
27
|
countDownNumbersColor:(NSString * )countDownNumbersColor
|
|
28
|
+
flowUiLanguage:(NSString * )flowUiLanguage
|
|
28
29
|
)
|
|
29
30
|
RCT_EXTERN_METHOD(startScanPassport:
|
|
30
31
|
(NSString *)language
|
|
@@ -69,7 +70,7 @@ RCT_EXTERN_METHOD(startFlow:(NSString *)logoUrl
|
|
|
69
70
|
holdUntilClickColors:(nonnull NSNumber *)holdUntilClickColors
|
|
70
71
|
backgroundType:(NSString *)backgroundType
|
|
71
72
|
clear:(BOOL)clear
|
|
72
|
-
|
|
73
|
+
extractedDataLanguage:(NSString *)extractedDataLanguage
|
|
73
74
|
enableNfc:(BOOL)enableNfc
|
|
74
75
|
enableQr:(BOOL)enableQr
|
|
75
76
|
blockLoaderCustomProperties:(NSString *)blockLoaderCustomProperties
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import ObjectiveC
|
|
2
2
|
import UIKit
|
|
3
3
|
import Foundation
|
|
4
|
+
import React
|
|
4
5
|
import AssentifySdk
|
|
6
|
+
import AssentifySdkReactNative
|
|
5
7
|
|
|
6
8
|
@objc(NativeAssentifySdk)
|
|
7
|
-
class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDelegate,FlowDelegate{
|
|
9
|
+
public class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDelegate,FlowDelegate,AssentifySdkEventEmitting{
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
|
|
@@ -48,6 +50,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
48
50
|
minCPUCores:NSNumber,
|
|
49
51
|
manualClickColor:String,
|
|
50
52
|
countDownNumbersColor: String = "#f5a103",
|
|
53
|
+
flowUiLanguage: String = "en",
|
|
51
54
|
) -> Void {
|
|
52
55
|
|
|
53
56
|
if(apiKey.isEmpty || configFileName.isEmpty ){
|
|
@@ -83,6 +86,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
83
86
|
print("\(tag) MinCPUCores: \(minCPUCores)")
|
|
84
87
|
print("\(tag) ManualClickColor: \(manualClickColor)")
|
|
85
88
|
print("\(tag) CountDownNumbersColor: \(countDownNumbersColor)")
|
|
89
|
+
print("\(tag) flowUiLanguage: \(flowUiLanguage)")
|
|
86
90
|
print("\(tag) ==============================================")
|
|
87
91
|
|
|
88
92
|
|
|
@@ -125,7 +129,8 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
125
129
|
activeLivenessCheckCount:activeLivenessCheckCount.intValue,
|
|
126
130
|
faceLivenessRetryCount:faceLivenessRetryCount.intValue,
|
|
127
131
|
minRam:iOSMinRam.intValue,
|
|
128
|
-
minCPUCores:minCPUCores.intValue
|
|
132
|
+
minCPUCores:minCPUCores.intValue,
|
|
133
|
+
flowUiLanguage:flowUiLanguage
|
|
129
134
|
)
|
|
130
135
|
|
|
131
136
|
self.holdHandColor = ENV_CustomColor;
|
|
@@ -145,14 +150,14 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
145
150
|
|
|
146
151
|
}
|
|
147
152
|
|
|
148
|
-
func onAssentifySdkInitError(message: String) {
|
|
153
|
+
public func onAssentifySdkInitError(message: String) {
|
|
149
154
|
DispatchQueue.main.async {
|
|
150
155
|
let eventResultMap: [String: Any] = ["assentifySdkInitSuccess": false]
|
|
151
156
|
self.sendEvent(withName: "AppResult",body : eventResultMap)
|
|
152
157
|
}
|
|
153
158
|
}
|
|
154
159
|
|
|
155
|
-
func onAssentifySdkInitSuccess(configModel: ConfigModel) {
|
|
160
|
+
public func onAssentifySdkInitSuccess(configModel: ConfigModel) {
|
|
156
161
|
configModel.stepDefinitions.forEach{step in
|
|
157
162
|
if UserDefaults.standard.object(forKey: String(step.stepId)) != nil {
|
|
158
163
|
UserDefaults.standard.removeObject(forKey: String(step.stepId))
|
|
@@ -188,7 +193,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
188
193
|
|
|
189
194
|
|
|
190
195
|
|
|
191
|
-
override func supportedEvents() -> [String]! {
|
|
196
|
+
public override func supportedEvents() -> [String]! {
|
|
192
197
|
return [
|
|
193
198
|
"AppResult",
|
|
194
199
|
"EventResult",
|
|
@@ -440,7 +445,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
440
445
|
extractedInformationBlockLoader[property.key] = self.configModel?.instanceHash
|
|
441
446
|
|
|
442
447
|
}
|
|
443
|
-
if (property.key.contains(BlockLoaderKeys.interactionID)) {
|
|
448
|
+
if (property.key.contains(AssentifySdkReactNative.BlockLoaderKeys.interactionID)) {
|
|
444
449
|
extractedInformationBlockLoader[property.key] = self.configModel?.instanceId
|
|
445
450
|
}
|
|
446
451
|
if !data.isEmpty {
|
|
@@ -474,7 +479,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
474
479
|
|
|
475
480
|
}
|
|
476
481
|
|
|
477
|
-
func onSubmitError(message: String) {
|
|
482
|
+
public func onSubmitError(message: String) {
|
|
478
483
|
DispatchQueue.main.async {
|
|
479
484
|
let eventResultMap: [String: Any] = [
|
|
480
485
|
"success": false,
|
|
@@ -483,7 +488,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
483
488
|
}
|
|
484
489
|
}
|
|
485
490
|
|
|
486
|
-
func onSubmitSuccess() {
|
|
491
|
+
public func onSubmitSuccess() {
|
|
487
492
|
DispatchQueue.main.async {
|
|
488
493
|
let eventResultMap: [String: Any] = [
|
|
489
494
|
"success": true,
|
|
@@ -657,7 +662,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
657
662
|
holdUntilClickColors: NSNumber,
|
|
658
663
|
backgroundType: String,
|
|
659
664
|
clear: Bool,
|
|
660
|
-
|
|
665
|
+
extractedDataLanguage: String,
|
|
661
666
|
enableNfc: Bool,
|
|
662
667
|
enableQr: Bool,
|
|
663
668
|
blockLoaderCustomProperties: String,
|
|
@@ -682,7 +687,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
682
687
|
holdUntilClickColors: holdUntilClickColors,
|
|
683
688
|
backgroundType: backgroundType,
|
|
684
689
|
clear: clear,
|
|
685
|
-
|
|
690
|
+
extractedDataLanguage: extractedDataLanguage,
|
|
686
691
|
enableNfc: enableNfc,
|
|
687
692
|
enableQr: enableQr,
|
|
688
693
|
blockLoaderCustomProperties: blockLoaderCustomProperties,
|
|
@@ -712,7 +717,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
712
717
|
holdUntilClickColors: NSNumber,
|
|
713
718
|
backgroundType: String,
|
|
714
719
|
clear: Bool,
|
|
715
|
-
|
|
720
|
+
extractedDataLanguage: String,
|
|
716
721
|
enableNfc: Bool,
|
|
717
722
|
enableQr: Bool,
|
|
718
723
|
blockLoaderCustomProperties: String,
|
|
@@ -756,7 +761,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
756
761
|
print("\(tag) clickColors: \(clickColors)")
|
|
757
762
|
print("\(tag) angleDegreesClickColors: \(angleClick)")
|
|
758
763
|
print("\(tag) holdUntilClickColors: \(holdClick)")
|
|
759
|
-
print("\(tag)
|
|
764
|
+
print("\(tag) extractedDataLanguage: \(extractedDataLanguage)")
|
|
760
765
|
print("\(tag) enableNfc: \(enableNfc)")
|
|
761
766
|
print("\(tag) enableQr: \(enableQr)")
|
|
762
767
|
print("\(tag) clear: \(clear)")
|
|
@@ -831,7 +836,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
831
836
|
rangeStart: rangeStart.intValue,
|
|
832
837
|
rangeEnd:rangeEnd.intValue,
|
|
833
838
|
stepperTitle:stepperTitle,
|
|
834
|
-
|
|
839
|
+
extractedDataLanguage: extractedDataLanguage,
|
|
835
840
|
enableNfc: enableNfc,
|
|
836
841
|
enableQr: enableQr,
|
|
837
842
|
showCountDown:showCountDown,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import UIKit
|
|
2
|
+
import React
|
|
2
3
|
import AssentifySdk
|
|
3
4
|
|
|
4
5
|
class PassportScannerView: UIView, ScanPassportDelegate {
|
|
@@ -242,13 +243,13 @@ class PassportScannerView: UIView, ScanPassportDelegate {
|
|
|
242
243
|
}
|
|
243
244
|
|
|
244
245
|
@objc (RNPassportScanner)
|
|
245
|
-
class RNPassportScanner: RCTViewManager {
|
|
246
|
+
public class RNPassportScanner: RCTViewManager {
|
|
246
247
|
|
|
247
|
-
override static func requiresMainQueueSetup() -> Bool {
|
|
248
|
+
public override static func requiresMainQueueSetup() -> Bool {
|
|
248
249
|
return true
|
|
249
250
|
}
|
|
250
251
|
|
|
251
|
-
override func view() -> UIView! {
|
|
252
|
+
public override func view() -> UIView! {
|
|
252
253
|
return PassportScannerView()
|
|
253
254
|
}
|
|
254
255
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
// Breaks the circular module dependency between the View layer (precompiled,
|
|
4
|
+
// no React dependency) and the bridge-registration layer (NativeAssentifySdk,
|
|
5
|
+
// built via CocoaPods since it needs RCTEventEmitter). View only ever needs to
|
|
6
|
+
// call sendEvent, so it depends on this protocol instead of the concrete
|
|
7
|
+
// NativeAssentifySdk/RCTEventEmitter type.
|
|
8
|
+
public protocol AssentifySdkEventEmitting: AnyObject {
|
|
9
|
+
func sendEvent(withName name: String!, body: Any!)
|
|
10
|
+
}
|
|
@@ -13,29 +13,29 @@ enum IDType{
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
struct StepsName {
|
|
17
|
-
static let DocumentCapture = "IdentificationDocumentCapture"
|
|
18
|
-
static let FaceMatch = "FaceImageAcquisition"
|
|
19
|
-
static let ContextAwareSigning = "ContextAwareSigning"
|
|
20
|
-
static let WrapUp = "WrapUp"
|
|
21
|
-
static let BlockLoader = "BlockLoader"
|
|
16
|
+
public struct StepsName {
|
|
17
|
+
public static let DocumentCapture = "IdentificationDocumentCapture"
|
|
18
|
+
public static let FaceMatch = "FaceImageAcquisition"
|
|
19
|
+
public static let ContextAwareSigning = "ContextAwareSigning"
|
|
20
|
+
public static let WrapUp = "WrapUp"
|
|
21
|
+
public static let BlockLoader = "BlockLoader"
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
struct WrapUpKeys {
|
|
27
|
-
static let TimeEnded = "OnBoardMe_WrapUp_TimeEnded"
|
|
26
|
+
public struct WrapUpKeys {
|
|
27
|
+
public static let TimeEnded = "OnBoardMe_WrapUp_TimeEnded"
|
|
28
28
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
struct BlockLoaderKeys {
|
|
32
|
-
static let DeviceName = "OnBoardMe_BlockLoader_DeviceName"
|
|
33
|
-
static let FlowName = "OnBoardMe_BlockLoader_FlowName"
|
|
34
|
-
static let TimeStarted = "OnBoardMe_BlockLoader_TimeStarted"
|
|
35
|
-
static let Application = "OnBoardMe_BlockLoader_Application"
|
|
36
|
-
static let UserAgent = "OnBoardMe_BlockLoader_UserAgent"
|
|
37
|
-
static let InstanceHash = "OnBoardMe_BlockLoader_InstanceHash"
|
|
38
|
-
static let interactionID = "OnBoardMe_BlockLoader_Interaction"
|
|
31
|
+
public struct BlockLoaderKeys {
|
|
32
|
+
public static let DeviceName = "OnBoardMe_BlockLoader_DeviceName"
|
|
33
|
+
public static let FlowName = "OnBoardMe_BlockLoader_FlowName"
|
|
34
|
+
public static let TimeStarted = "OnBoardMe_BlockLoader_TimeStarted"
|
|
35
|
+
public static let Application = "OnBoardMe_BlockLoader_Application"
|
|
36
|
+
public static let UserAgent = "OnBoardMe_BlockLoader_UserAgent"
|
|
37
|
+
public static let InstanceHash = "OnBoardMe_BlockLoader_InstanceHash"
|
|
38
|
+
public static let interactionID = "OnBoardMe_BlockLoader_Interaction"
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
|