assentify-sdk-react-native 1.0.0-Beta.4 → 1.0.0-Beta.40
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 +120 -32
- package/android/build.gradle +1 -6
- package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +48 -9
- package/android/src/main/java/com/assentifysdk/FlowActivity.kt +75 -7
- package/android/src/main/java/com/assentifysdk/ScanIDActivity.kt +5 -4
- package/android/src/main/res/layout/activity_scan.xml +45 -57
- package/ios/AssentifySdkBaseModule.swift +1 -0
- package/ios/NativeAssentifySdk.mm +19 -2
- package/ios/NativeAssentifySdk.swift +151 -25
- 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/ClickFontWeightType.js +14 -0
- package/lib/commonjs/ClickFontWeightType.js.map +1 -0
- package/lib/commonjs/FlowStepperType.js +11 -0
- package/lib/commonjs/FlowStepperType.js.map +1 -0
- package/lib/commonjs/Language.js +5 -1
- package/lib/commonjs/Language.js.map +1 -1
- package/lib/commonjs/ValidationStyleType.js +11 -0
- package/lib/commonjs/ValidationStyleType.js.map +1 -0
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.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/ClickFontWeightType.js +8 -0
- package/lib/module/ClickFontWeightType.js.map +1 -0
- package/lib/module/FlowStepperType.js +5 -0
- package/lib/module/FlowStepperType.js.map +1 -0
- package/lib/module/Language.js +4 -0
- package/lib/module/Language.js.map +1 -1
- package/lib/module/ValidationStyleType.js +5 -0
- package/lib/module/ValidationStyleType.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.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/ClickFontWeightType.d.ts +9 -0
- package/lib/typescript/lib/commonjs/ClickFontWeightType.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/FlowStepperType.d.ts +6 -0
- package/lib/typescript/lib/commonjs/FlowStepperType.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Language.d.ts +6 -0
- package/lib/typescript/lib/commonjs/ValidationStyleType.d.ts +6 -0
- package/lib/typescript/lib/commonjs/ValidationStyleType.d.ts.map +1 -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/ClickFontWeightType.d.ts +8 -0
- package/lib/typescript/lib/module/ClickFontWeightType.d.ts.map +1 -0
- package/lib/typescript/lib/module/FlowStepperType.d.ts +5 -0
- package/lib/typescript/lib/module/FlowStepperType.d.ts.map +1 -0
- package/lib/typescript/lib/module/Language.d.ts +6 -0
- package/lib/typescript/lib/module/ValidationStyleType.d.ts +5 -0
- package/lib/typescript/lib/module/ValidationStyleType.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +5 -2
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyWrapper.d.ts +6 -2
- package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/src/ClickFontWeightType.d.ts +9 -0
- package/lib/typescript/src/ClickFontWeightType.d.ts.map +1 -0
- package/lib/typescript/src/FlowStepperType.d.ts +6 -0
- package/lib/typescript/src/FlowStepperType.d.ts.map +1 -0
- package/lib/typescript/src/Language.d.ts +5 -0
- package/lib/typescript/src/Language.d.ts.map +1 -1
- package/lib/typescript/src/ValidationStyleType.d.ts +6 -0
- package/lib/typescript/src/ValidationStyleType.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/AssentifyProvider.tsx +341 -305
- package/src/AssentifyWrapper.ts +47 -6
- package/src/ClickFontWeightType.ts +10 -0
- package/src/FlowStepperType.ts +7 -0
- package/src/Language.ts +7 -0
- package/src/ValidationStyleType.ts +7 -0
- package/src/index.ts +3 -0
- package/src/types.ts +1 -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
|
@@ -309,58 +309,52 @@
|
|
|
309
309
|
android:layout_marginEnd="16dp"
|
|
310
310
|
android:layout_marginBottom="30dp"/>
|
|
311
311
|
|
|
312
|
-
|
|
313
|
-
<LinearLayout
|
|
312
|
+
<androidx.constraintlayout.widget.ConstraintLayout
|
|
314
313
|
android:id="@+id/backIDPage"
|
|
315
314
|
android:visibility="gone"
|
|
316
315
|
android:layout_width="match_parent"
|
|
317
316
|
android:layout_height="match_parent"
|
|
318
|
-
android:orientation="vertical"
|
|
319
|
-
android:paddingStart="24dp"
|
|
320
|
-
android:paddingEnd="24dp"
|
|
321
|
-
android:paddingTop="24dp"
|
|
322
|
-
android:paddingBottom="24dp"
|
|
323
317
|
android:background="@color/Green">
|
|
318
|
+
|
|
319
|
+
<!-- Always middle: constrained top-to-top of parent AND bottom-to-top of the button,
|
|
320
|
+
with wrap_content height. ConstraintLayout centers a wrap_content view between
|
|
321
|
+
two opposing constraints by default (bias 0.5), so this stays vertically centered
|
|
322
|
+
in whatever space is left above the button, on any screen height. -->
|
|
324
323
|
<LinearLayout
|
|
324
|
+
android:id="@+id/middleContent"
|
|
325
325
|
android:layout_width="match_parent"
|
|
326
|
-
android:layout_height="
|
|
327
|
-
android:layout_gravity="center_vertical"
|
|
328
|
-
android:layout_marginTop="00dp"
|
|
329
|
-
android:gravity="center"
|
|
326
|
+
android:layout_height="wrap_content"
|
|
330
327
|
android:orientation="vertical"
|
|
331
|
-
android:
|
|
332
|
-
android:
|
|
333
|
-
android:
|
|
334
|
-
android:
|
|
335
|
-
|
|
328
|
+
android:gravity="center_horizontal"
|
|
329
|
+
android:paddingStart="24dp"
|
|
330
|
+
android:paddingEnd="24dp"
|
|
331
|
+
android:paddingTop="24dp"
|
|
332
|
+
android:paddingBottom="24dp"
|
|
333
|
+
app:layout_constraintTop_toTopOf="parent"
|
|
334
|
+
app:layout_constraintBottom_toTopOf="@id/nextTemplate"
|
|
335
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
336
|
+
app:layout_constraintEnd_toEndOf="parent">
|
|
336
337
|
|
|
337
338
|
<TextView
|
|
338
339
|
android:id="@+id/tvInstruction"
|
|
339
|
-
android:layout_width="
|
|
340
|
+
android:layout_width="match_parent"
|
|
340
341
|
android:layout_height="wrap_content"
|
|
341
|
-
android:paddingTop="120dp"
|
|
342
342
|
android:text="Please flip the card provided to take the back of the card"
|
|
343
343
|
android:textColor="@android:color/white"
|
|
344
344
|
android:textSize="20sp"
|
|
345
345
|
android:gravity="center"
|
|
346
|
-
android:textStyle="bold"
|
|
347
|
-
app:layout_constraintStart_toStartOf="parent"
|
|
348
|
-
app:layout_constraintEnd_toEndOf="parent"
|
|
349
|
-
tools:ignore="MissingConstraints" />
|
|
346
|
+
android:textStyle="bold" />
|
|
350
347
|
|
|
351
348
|
<ImageView
|
|
352
349
|
android:id="@+id/ivSample"
|
|
353
350
|
android:layout_width="wrap_content"
|
|
351
|
+
android:layout_height="wrap_content"
|
|
352
|
+
android:layout_marginTop="40dp"
|
|
354
353
|
android:layout_margin="10dp"
|
|
355
354
|
android:padding="10dp"
|
|
356
|
-
android:layout_height="wrap_content"
|
|
357
|
-
android:paddingTop="100dp"
|
|
358
355
|
android:contentDescription="@string/app_name"
|
|
359
356
|
android:scaleType="fitXY"
|
|
360
|
-
android:layout_gravity="center"
|
|
361
|
-
app:layout_constraintTop_toBottomOf="@id/tvInstruction"
|
|
362
|
-
app:layout_constraintStart_toStartOf="parent"
|
|
363
|
-
app:layout_constraintEnd_toEndOf="parent" />
|
|
357
|
+
android:layout_gravity="center" />
|
|
364
358
|
|
|
365
359
|
<!-- Caption -->
|
|
366
360
|
<TextView
|
|
@@ -371,43 +365,37 @@
|
|
|
371
365
|
android:layout_marginTop="15dp"
|
|
372
366
|
android:text="Expected Card Type"
|
|
373
367
|
android:textColor="@color/white"
|
|
374
|
-
android:textSize="12sp"
|
|
375
|
-
app:layout_constraintTop_toBottomOf="@id/ivSample"
|
|
376
|
-
app:layout_constraintStart_toStartOf="parent"
|
|
377
|
-
app:layout_constraintEnd_toEndOf="parent" />
|
|
368
|
+
android:textSize="12sp" />
|
|
378
369
|
|
|
379
370
|
<pl.droidsonroids.gif.GifImageView
|
|
380
371
|
android:id="@+id/gifCard"
|
|
381
|
-
android:visibility="visible"
|
|
382
|
-
app:layout_constraintTop_toBottomOf="@id/tvCaption"
|
|
383
372
|
android:layout_width="150dp"
|
|
384
373
|
android:layout_height="150dp"
|
|
385
|
-
android:background="@null"
|
|
386
|
-
android:src="@drawable/card"
|
|
387
|
-
tools:ignore="MissingConstraints" />
|
|
388
|
-
|
|
389
|
-
<Button
|
|
390
|
-
android:id="@+id/nextTemplate"
|
|
391
|
-
android:layout_width="match_parent"
|
|
392
|
-
android:layout_height="56dp"
|
|
393
|
-
android:text="Next"
|
|
394
|
-
android:textAllCaps="false"
|
|
395
|
-
android:textColor="@android:color/white"
|
|
396
|
-
app:cornerRadius="30dp"
|
|
397
|
-
app:layout_constraintStart_toStartOf="parent"
|
|
398
|
-
app:layout_constraintEnd_toEndOf="parent"
|
|
399
|
-
app:layout_constraintBottom_toBottomOf="parent"
|
|
400
|
-
android:layout_marginStart="10dp"
|
|
401
|
-
android:layout_marginEnd="10dp"
|
|
402
374
|
android:layout_marginTop="15dp"
|
|
403
|
-
android:
|
|
375
|
+
android:layout_gravity="center"
|
|
376
|
+
android:background="@null"
|
|
377
|
+
android:src="@drawable/card" />
|
|
404
378
|
|
|
405
379
|
</LinearLayout>
|
|
406
380
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
381
|
+
<!-- Fixed bottom bar. Pinned directly to the parent ConstraintLayout's bottom edge,
|
|
382
|
+
so its position never depends on the content above — it is always laid out
|
|
383
|
+
and always clickable, no matter the screen height. -->
|
|
384
|
+
<Button
|
|
385
|
+
android:id="@+id/nextTemplate"
|
|
386
|
+
android:layout_width="match_parent"
|
|
387
|
+
android:layout_height="56dp"
|
|
388
|
+
android:text="Next"
|
|
389
|
+
android:textAllCaps="false"
|
|
390
|
+
android:textColor="@android:color/white"
|
|
391
|
+
app:cornerRadius="30dp"
|
|
392
|
+
android:layout_marginStart="30dp"
|
|
393
|
+
android:layout_marginEnd="30dp"
|
|
394
|
+
android:layout_marginBottom="10dp"
|
|
395
|
+
app:layout_constraintStart_toStartOf="parent"
|
|
396
|
+
app:layout_constraintEnd_toEndOf="parent"
|
|
397
|
+
app:layout_constraintBottom_toBottomOf="parent" />
|
|
398
|
+
|
|
399
|
+
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
412
400
|
|
|
413
401
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
RCT_EXTERN_METHOD(initialize: (NSString *)apiKey
|
|
7
7
|
configFileName:(NSString *)configFileName
|
|
8
|
+
processJsonConfigFile:(NSString *)processJsonConfigFile
|
|
8
9
|
performLivenessFace:(BOOL *)performLivenessFace
|
|
9
10
|
ENV_CustomColor:(NSString *)ENV_CustomColor
|
|
10
11
|
enableDetect:(BOOL *)enableDetect
|
|
@@ -24,6 +25,7 @@ RCT_EXTERN_METHOD(initialize: (NSString *)apiKey
|
|
|
24
25
|
minCPUCores:(nonnull NSNumber * )minCPUCores
|
|
25
26
|
manualClickColor:(NSString * )manualClickColor
|
|
26
27
|
countDownNumbersColor:(NSString * )countDownNumbersColor
|
|
28
|
+
flowUiLanguage:(NSString * )flowUiLanguage
|
|
27
29
|
)
|
|
28
30
|
RCT_EXTERN_METHOD(startScanPassport:
|
|
29
31
|
(NSString *)language
|
|
@@ -68,10 +70,25 @@ RCT_EXTERN_METHOD(startFlow:(NSString *)logoUrl
|
|
|
68
70
|
holdUntilClickColors:(nonnull NSNumber *)holdUntilClickColors
|
|
69
71
|
backgroundType:(NSString *)backgroundType
|
|
70
72
|
clear:(BOOL)clear
|
|
71
|
-
|
|
73
|
+
extractedDataLanguage:(NSString *)extractedDataLanguage
|
|
72
74
|
enableNfc:(BOOL)enableNfc
|
|
73
75
|
enableQr:(BOOL)enableQr
|
|
74
|
-
blockLoaderCustomProperties:(NSString *)blockLoaderCustomProperties
|
|
76
|
+
blockLoaderCustomProperties:(NSString *)blockLoaderCustomProperties
|
|
77
|
+
stepperType:(NSString *)stepperType
|
|
78
|
+
rangeStart:(NSNumber *)rangeStart
|
|
79
|
+
rangeEnd:(NSNumber *)rangeEnd
|
|
80
|
+
stepperTitle:(NSString *)stepperTitle
|
|
81
|
+
showCountDown:(BOOL)showCountDown
|
|
82
|
+
validationStyle:(NSString *)validationStyle
|
|
83
|
+
stepperTitleColor:(NSString *)stepperTitleColor
|
|
84
|
+
howToCapturePassportVideo:(NSString *)howToCapturePassportVideo
|
|
85
|
+
howToCaptureIDVideo:(NSString *)howToCaptureIDVideo
|
|
86
|
+
howToCaptureFaceVideo:(NSString *)howToCaptureFaceVideo
|
|
87
|
+
clickFontWeight:(NSString *)clickFontWeight
|
|
88
|
+
hideBlockLoader:(BOOL)hideBlockLoader
|
|
89
|
+
hideWrapUp:(BOOL)hideWrapUp
|
|
90
|
+
localMrzScan:(BOOL)localMrzScan
|
|
91
|
+
faceAcceptanceRate:(NSNumber *)faceAcceptanceRate)
|
|
75
92
|
|
|
76
93
|
|
|
77
94
|
RCT_EXTERN_METHOD(supportedEvents)
|
|
@@ -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
|
|
|
@@ -28,6 +30,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
28
30
|
func initialize(_
|
|
29
31
|
apiKey: String,
|
|
30
32
|
configFileName: String,
|
|
33
|
+
processJsonConfigFile: String = "",
|
|
31
34
|
performLivenessFace: Bool = false,
|
|
32
35
|
ENV_CustomColor: String = "#f5a103",
|
|
33
36
|
enableDetect: Bool = true,
|
|
@@ -47,6 +50,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
47
50
|
minCPUCores:NSNumber,
|
|
48
51
|
manualClickColor:String,
|
|
49
52
|
countDownNumbersColor: String = "#f5a103",
|
|
53
|
+
flowUiLanguage: String = "en",
|
|
50
54
|
) -> Void {
|
|
51
55
|
|
|
52
56
|
if(apiKey.isEmpty || configFileName.isEmpty ){
|
|
@@ -62,6 +66,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
62
66
|
print("\(tag) Assentify SDK Initialized")
|
|
63
67
|
print("\(tag) apiKey: \(apiKey)")
|
|
64
68
|
print("\(tag) configFileName: \(configFileName)")
|
|
69
|
+
print("\(tag) processJsonConfigFile: \(processJsonConfigFile)")
|
|
65
70
|
print("\(tag) performLivenessFace: \(performLivenessFace)")
|
|
66
71
|
print("\(tag) ENV_CustomColor: \(ENV_CustomColor)")
|
|
67
72
|
print("\(tag) enableDetect: \(enableDetect)")
|
|
@@ -81,6 +86,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
81
86
|
print("\(tag) MinCPUCores: \(minCPUCores)")
|
|
82
87
|
print("\(tag) ManualClickColor: \(manualClickColor)")
|
|
83
88
|
print("\(tag) CountDownNumbersColor: \(countDownNumbersColor)")
|
|
89
|
+
print("\(tag) flowUiLanguage: \(flowUiLanguage)")
|
|
84
90
|
print("\(tag) ==============================================")
|
|
85
91
|
|
|
86
92
|
|
|
@@ -123,7 +129,8 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
123
129
|
activeLivenessCheckCount:activeLivenessCheckCount.intValue,
|
|
124
130
|
faceLivenessRetryCount:faceLivenessRetryCount.intValue,
|
|
125
131
|
minRam:iOSMinRam.intValue,
|
|
126
|
-
minCPUCores:minCPUCores.intValue
|
|
132
|
+
minCPUCores:minCPUCores.intValue,
|
|
133
|
+
flowUiLanguage:flowUiLanguage
|
|
127
134
|
)
|
|
128
135
|
|
|
129
136
|
self.holdHandColor = ENV_CustomColor;
|
|
@@ -136,20 +143,21 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
136
143
|
configFileName: configFileName,
|
|
137
144
|
environmentalConditions: environmentalConditions,
|
|
138
145
|
assentifySdkDelegate: self,
|
|
139
|
-
performActiveLivenessFace: performLivenessFace
|
|
146
|
+
performActiveLivenessFace: performLivenessFace,
|
|
147
|
+
processJsonConfigFile: processJsonConfigFile
|
|
140
148
|
)
|
|
141
149
|
|
|
142
150
|
|
|
143
151
|
}
|
|
144
152
|
|
|
145
|
-
func onAssentifySdkInitError(message: String) {
|
|
153
|
+
public func onAssentifySdkInitError(message: String) {
|
|
146
154
|
DispatchQueue.main.async {
|
|
147
155
|
let eventResultMap: [String: Any] = ["assentifySdkInitSuccess": false]
|
|
148
156
|
self.sendEvent(withName: "AppResult",body : eventResultMap)
|
|
149
157
|
}
|
|
150
158
|
}
|
|
151
159
|
|
|
152
|
-
func onAssentifySdkInitSuccess(configModel: ConfigModel) {
|
|
160
|
+
public func onAssentifySdkInitSuccess(configModel: ConfigModel) {
|
|
153
161
|
configModel.stepDefinitions.forEach{step in
|
|
154
162
|
if UserDefaults.standard.object(forKey: String(step.stepId)) != nil {
|
|
155
163
|
UserDefaults.standard.removeObject(forKey: String(step.stepId))
|
|
@@ -160,12 +168,13 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
160
168
|
self.stepDefinitions = configModel.stepDefinitions;
|
|
161
169
|
self.configModel = configModel;
|
|
162
170
|
|
|
163
|
-
|
|
164
|
-
.first
|
|
165
|
-
.id
|
|
171
|
+
let stepId = configModel.stepMap
|
|
172
|
+
.first { $0.stepDefinition == StepsNames.identificationDocumentCapture }?
|
|
173
|
+
.id
|
|
166
174
|
|
|
167
|
-
|
|
168
|
-
|
|
175
|
+
self.templatesByCountry = stepId.flatMap {
|
|
176
|
+
self.assentifySdk?.getTemplates(stepID: $0)
|
|
177
|
+
} ?? []
|
|
169
178
|
|
|
170
179
|
do {
|
|
171
180
|
let jsonDataTemplates = try JSONEncoder().encode(self.templatesByCountry)
|
|
@@ -184,7 +193,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
184
193
|
|
|
185
194
|
|
|
186
195
|
|
|
187
|
-
override func supportedEvents() -> [String]! {
|
|
196
|
+
public override func supportedEvents() -> [String]! {
|
|
188
197
|
return [
|
|
189
198
|
"AppResult",
|
|
190
199
|
"EventResult",
|
|
@@ -436,7 +445,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
436
445
|
extractedInformationBlockLoader[property.key] = self.configModel?.instanceHash
|
|
437
446
|
|
|
438
447
|
}
|
|
439
|
-
if (property.key.contains(BlockLoaderKeys.interactionID)) {
|
|
448
|
+
if (property.key.contains(AssentifySdkReactNative.BlockLoaderKeys.interactionID)) {
|
|
440
449
|
extractedInformationBlockLoader[property.key] = self.configModel?.instanceId
|
|
441
450
|
}
|
|
442
451
|
if !data.isEmpty {
|
|
@@ -470,7 +479,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
470
479
|
|
|
471
480
|
}
|
|
472
481
|
|
|
473
|
-
func onSubmitError(message: String) {
|
|
482
|
+
public func onSubmitError(message: String) {
|
|
474
483
|
DispatchQueue.main.async {
|
|
475
484
|
let eventResultMap: [String: Any] = [
|
|
476
485
|
"success": false,
|
|
@@ -479,7 +488,7 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
479
488
|
}
|
|
480
489
|
}
|
|
481
490
|
|
|
482
|
-
func onSubmitSuccess() {
|
|
491
|
+
public func onSubmitSuccess() {
|
|
483
492
|
DispatchQueue.main.async {
|
|
484
493
|
let eventResultMap: [String: Any] = [
|
|
485
494
|
"success": true,
|
|
@@ -653,10 +662,26 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
653
662
|
holdUntilClickColors: NSNumber,
|
|
654
663
|
backgroundType: String,
|
|
655
664
|
clear: Bool,
|
|
656
|
-
|
|
665
|
+
extractedDataLanguage: String,
|
|
657
666
|
enableNfc: Bool,
|
|
658
667
|
enableQr: Bool,
|
|
659
|
-
blockLoaderCustomProperties: String
|
|
668
|
+
blockLoaderCustomProperties: String,
|
|
669
|
+
stepperType: String,
|
|
670
|
+
rangeStart: NSNumber,
|
|
671
|
+
rangeEnd: NSNumber,
|
|
672
|
+
stepperTitle: String,
|
|
673
|
+
showCountDown: Bool,
|
|
674
|
+
validationStyle: String,
|
|
675
|
+
stepperTitleColor: String,
|
|
676
|
+
howToCapturePassportVideo: String,
|
|
677
|
+
howToCaptureIDVideo: String,
|
|
678
|
+
howToCaptureFaceVideo: String,
|
|
679
|
+
clickFontWeight: String,
|
|
680
|
+
hideBlockLoader: Bool,
|
|
681
|
+
hideWrapUp: Bool,
|
|
682
|
+
localMrzScan: Bool,
|
|
683
|
+
faceAcceptanceRate: NSNumber
|
|
684
|
+
|
|
660
685
|
) {
|
|
661
686
|
navToFlow(
|
|
662
687
|
logoUrl:logoUrl,
|
|
@@ -673,10 +698,25 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
673
698
|
holdUntilClickColors: holdUntilClickColors,
|
|
674
699
|
backgroundType: backgroundType,
|
|
675
700
|
clear: clear,
|
|
676
|
-
|
|
701
|
+
extractedDataLanguage: extractedDataLanguage,
|
|
677
702
|
enableNfc: enableNfc,
|
|
678
703
|
enableQr: enableQr,
|
|
679
|
-
blockLoaderCustomProperties: blockLoaderCustomProperties
|
|
704
|
+
blockLoaderCustomProperties: blockLoaderCustomProperties,
|
|
705
|
+
stepperType: stepperType,
|
|
706
|
+
rangeStart: rangeStart,
|
|
707
|
+
rangeEnd: rangeEnd,
|
|
708
|
+
stepperTitle: stepperTitle,
|
|
709
|
+
showCountDown: showCountDown,
|
|
710
|
+
validationStyle: validationStyle,
|
|
711
|
+
stepperTitleColor: stepperTitleColor,
|
|
712
|
+
howToCapturePassportVideo: howToCapturePassportVideo,
|
|
713
|
+
howToCaptureIDVideo: howToCaptureIDVideo,
|
|
714
|
+
howToCaptureFaceVideo: howToCaptureFaceVideo,
|
|
715
|
+
clickFontWeight: clickFontWeight,
|
|
716
|
+
hideBlockLoader: hideBlockLoader,
|
|
717
|
+
hideWrapUp: hideWrapUp,
|
|
718
|
+
localMrzScan: localMrzScan,
|
|
719
|
+
faceAcceptanceRate: faceAcceptanceRate
|
|
680
720
|
)
|
|
681
721
|
}
|
|
682
722
|
|
|
@@ -698,10 +738,25 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
698
738
|
holdUntilClickColors: NSNumber,
|
|
699
739
|
backgroundType: String,
|
|
700
740
|
clear: Bool,
|
|
701
|
-
|
|
741
|
+
extractedDataLanguage: String,
|
|
702
742
|
enableNfc: Bool,
|
|
703
743
|
enableQr: Bool,
|
|
704
|
-
blockLoaderCustomProperties: String
|
|
744
|
+
blockLoaderCustomProperties: String,
|
|
745
|
+
stepperType: String,
|
|
746
|
+
rangeStart: NSNumber,
|
|
747
|
+
rangeEnd: NSNumber,
|
|
748
|
+
stepperTitle: String,
|
|
749
|
+
showCountDown: Bool,
|
|
750
|
+
validationStyle: String,
|
|
751
|
+
stepperTitleColor: String,
|
|
752
|
+
howToCapturePassportVideo: String,
|
|
753
|
+
howToCaptureIDVideo: String,
|
|
754
|
+
howToCaptureFaceVideo: String,
|
|
755
|
+
clickFontWeight: String,
|
|
756
|
+
hideBlockLoader: Bool,
|
|
757
|
+
hideWrapUp: Bool,
|
|
758
|
+
localMrzScan: Bool,
|
|
759
|
+
faceAcceptanceRate: NSNumber
|
|
705
760
|
) {
|
|
706
761
|
|
|
707
762
|
let angleBg = angleDegreesBackgroundColors.floatValue
|
|
@@ -737,13 +792,58 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
737
792
|
print("\(tag) clickColors: \(clickColors)")
|
|
738
793
|
print("\(tag) angleDegreesClickColors: \(angleClick)")
|
|
739
794
|
print("\(tag) holdUntilClickColors: \(holdClick)")
|
|
740
|
-
print("\(tag)
|
|
795
|
+
print("\(tag) extractedDataLanguage: \(extractedDataLanguage)")
|
|
741
796
|
print("\(tag) enableNfc: \(enableNfc)")
|
|
742
797
|
print("\(tag) enableQr: \(enableQr)")
|
|
743
798
|
print("\(tag) clear: \(clear)")
|
|
744
799
|
print("\(tag) blockLoaderCustomProperties: \(parsedBlockLoaderCustomProperties)")
|
|
800
|
+
print("\(tag) stepperType: \(stepperType)")
|
|
801
|
+
print("\(tag) rangeStart: \(rangeStart)")
|
|
802
|
+
print("\(tag) rangeEnd: \(rangeEnd)")
|
|
803
|
+
print("\(tag) stepperTitle: \(stepperTitle)")
|
|
804
|
+
print("\(tag) showCountDown: \(showCountDown)")
|
|
805
|
+
print("\(tag) validationStyle: \(validationStyle)")
|
|
806
|
+
print("\(tag) stepperTitleColor: \(stepperTitleColor)")
|
|
807
|
+
print("\(tag) howToCapturePassportVideo: \(howToCapturePassportVideo)")
|
|
808
|
+
print("\(tag) howToCaptureIDVideo: \(howToCaptureIDVideo)")
|
|
809
|
+
print("\(tag) howToCaptureFaceVideo: \(howToCaptureFaceVideo)")
|
|
810
|
+
print("\(tag) clickFontWeight: \(clickFontWeight)")
|
|
811
|
+
print("\(tag) hideBlockLoader: \(hideBlockLoader)")
|
|
812
|
+
print("\(tag) hideWrapUp: \(hideWrapUp)")
|
|
813
|
+
print("\(tag) localMrzScan: \(localMrzScan)")
|
|
814
|
+
print("\(tag) faceAcceptanceRate: \(faceAcceptanceRate)")
|
|
745
815
|
print("\(tag) =================================")
|
|
746
816
|
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
let validationStyleType: String = {
|
|
820
|
+
let style = validationStyle ?? ""
|
|
821
|
+
if style == "Message" {
|
|
822
|
+
return ValidationStyle.Message
|
|
823
|
+
} else if style == "Asterisk" {
|
|
824
|
+
return ValidationStyle.Asterisk
|
|
825
|
+
} else {
|
|
826
|
+
return ValidationStyle.Message
|
|
827
|
+
}
|
|
828
|
+
}()
|
|
829
|
+
|
|
830
|
+
let clickFontWeightType: String = {
|
|
831
|
+
switch (clickFontWeight ?? "") {
|
|
832
|
+
case "Normal":
|
|
833
|
+
return ClickFontWeight.Normal
|
|
834
|
+
case "Medium":
|
|
835
|
+
return ClickFontWeight.Medium
|
|
836
|
+
case "Bold":
|
|
837
|
+
return ClickFontWeight.Bold
|
|
838
|
+
case "SemiBold":
|
|
839
|
+
return ClickFontWeight.SemiBold
|
|
840
|
+
case "ExtraBold":
|
|
841
|
+
return ClickFontWeight.ExtraBold
|
|
842
|
+
default:
|
|
843
|
+
return ClickFontWeight.Normal
|
|
844
|
+
}
|
|
845
|
+
}()
|
|
846
|
+
|
|
747
847
|
let bType: BackgroundType = {
|
|
748
848
|
switch backgroundType.lowercased() {
|
|
749
849
|
case "image":
|
|
@@ -755,6 +855,17 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
755
855
|
}
|
|
756
856
|
}()
|
|
757
857
|
|
|
858
|
+
let sType: StepperType = {
|
|
859
|
+
switch stepperType {
|
|
860
|
+
case "Normal":
|
|
861
|
+
return .normal
|
|
862
|
+
case "PercentageBased":
|
|
863
|
+
return .percentageBased
|
|
864
|
+
default:
|
|
865
|
+
return .normal
|
|
866
|
+
}
|
|
867
|
+
}()
|
|
868
|
+
|
|
758
869
|
var backgroundColor: BackgroundStyle? = nil
|
|
759
870
|
var clickColor: BackgroundStyle? = nil
|
|
760
871
|
|
|
@@ -792,17 +903,32 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
792
903
|
accentColor: accentColor,
|
|
793
904
|
backgroundColor: backgroundColor,
|
|
794
905
|
clickColor: clickColor,
|
|
795
|
-
|
|
906
|
+
stepperType: sType,
|
|
907
|
+
rangeStart: rangeStart.intValue,
|
|
908
|
+
rangeEnd:rangeEnd.intValue,
|
|
909
|
+
stepperTitle:stepperTitle,
|
|
910
|
+
extractedDataLanguage: extractedDataLanguage,
|
|
796
911
|
enableNfc: enableNfc,
|
|
797
912
|
enableQr: enableQr,
|
|
798
|
-
|
|
913
|
+
showCountDown:showCountDown,
|
|
914
|
+
blockLoaderCustomProperties: parsedBlockLoaderCustomProperties,
|
|
915
|
+
validationStyle : validationStyleType ?? ValidationStyle.Message,
|
|
916
|
+
stepperTitleColor : stepperTitleColor ?? "",
|
|
917
|
+
howToCapturePassportVideo : howToCapturePassportVideo ?? "",
|
|
918
|
+
howToCaptureIDVideo : howToCaptureIDVideo ?? "",
|
|
919
|
+
howToCaptureFaceVideo : howToCaptureFaceVideo ?? "",
|
|
920
|
+
clickFontWeight : clickFontWeightType ?? ClickFontWeight.Normal,
|
|
921
|
+
hideBlockLoader : hideBlockLoader,
|
|
922
|
+
hideWrapUp : hideWrapUp,
|
|
923
|
+
localMrzScan:localMrzScan,
|
|
924
|
+
faceAcceptanceRate:faceAcceptanceRate.intValue
|
|
799
925
|
)
|
|
800
926
|
DispatchQueue.main.async {
|
|
801
|
-
|
|
927
|
+
|
|
802
928
|
if(clear){
|
|
803
929
|
self.assentifySdk!.clearFlow();
|
|
804
930
|
}
|
|
805
|
-
|
|
931
|
+
|
|
806
932
|
if let currentViewController = UIApplication.shared.keyWindow?.rootViewController {
|
|
807
933
|
|
|
808
934
|
self.assentifySdk!.startFlow(
|
|
@@ -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
|
|