assentify-sdk-react-native 1.0.0-Beta.3 → 1.0.0-Beta.30
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 +93 -32
- package/android/build.gradle +1 -6
- package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +46 -9
- package/android/src/main/java/com/assentifysdk/FlowActivity.kt +72 -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 +18 -2
- package/ios/NativeAssentifySdk.swift +146 -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 +45 -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,24 @@ 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)
|
|
75
91
|
|
|
76
92
|
|
|
77
93
|
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,25 @@ 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
|
+
|
|
660
684
|
) {
|
|
661
685
|
navToFlow(
|
|
662
686
|
logoUrl:logoUrl,
|
|
@@ -673,10 +697,24 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
673
697
|
holdUntilClickColors: holdUntilClickColors,
|
|
674
698
|
backgroundType: backgroundType,
|
|
675
699
|
clear: clear,
|
|
676
|
-
|
|
700
|
+
extractedDataLanguage: extractedDataLanguage,
|
|
677
701
|
enableNfc: enableNfc,
|
|
678
702
|
enableQr: enableQr,
|
|
679
|
-
blockLoaderCustomProperties: blockLoaderCustomProperties
|
|
703
|
+
blockLoaderCustomProperties: blockLoaderCustomProperties,
|
|
704
|
+
stepperType: stepperType,
|
|
705
|
+
rangeStart: rangeStart,
|
|
706
|
+
rangeEnd: rangeEnd,
|
|
707
|
+
stepperTitle: stepperTitle,
|
|
708
|
+
showCountDown: showCountDown,
|
|
709
|
+
validationStyle: validationStyle,
|
|
710
|
+
stepperTitleColor: stepperTitleColor,
|
|
711
|
+
howToCapturePassportVideo: howToCapturePassportVideo,
|
|
712
|
+
howToCaptureIDVideo: howToCaptureIDVideo,
|
|
713
|
+
howToCaptureFaceVideo: howToCaptureFaceVideo,
|
|
714
|
+
clickFontWeight: clickFontWeight,
|
|
715
|
+
hideBlockLoader: hideBlockLoader,
|
|
716
|
+
hideWrapUp: hideWrapUp,
|
|
717
|
+
localMrzScan: localMrzScan
|
|
680
718
|
)
|
|
681
719
|
}
|
|
682
720
|
|
|
@@ -698,10 +736,24 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
698
736
|
holdUntilClickColors: NSNumber,
|
|
699
737
|
backgroundType: String,
|
|
700
738
|
clear: Bool,
|
|
701
|
-
|
|
739
|
+
extractedDataLanguage: String,
|
|
702
740
|
enableNfc: Bool,
|
|
703
741
|
enableQr: Bool,
|
|
704
|
-
blockLoaderCustomProperties: String
|
|
742
|
+
blockLoaderCustomProperties: String,
|
|
743
|
+
stepperType: String,
|
|
744
|
+
rangeStart: NSNumber,
|
|
745
|
+
rangeEnd: NSNumber,
|
|
746
|
+
stepperTitle: String,
|
|
747
|
+
showCountDown: Bool,
|
|
748
|
+
validationStyle: String,
|
|
749
|
+
stepperTitleColor: String,
|
|
750
|
+
howToCapturePassportVideo: String,
|
|
751
|
+
howToCaptureIDVideo: String,
|
|
752
|
+
howToCaptureFaceVideo: String,
|
|
753
|
+
clickFontWeight: String,
|
|
754
|
+
hideBlockLoader: Bool,
|
|
755
|
+
hideWrapUp: Bool,
|
|
756
|
+
localMrzScan: Bool
|
|
705
757
|
) {
|
|
706
758
|
|
|
707
759
|
let angleBg = angleDegreesBackgroundColors.floatValue
|
|
@@ -737,13 +789,57 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
737
789
|
print("\(tag) clickColors: \(clickColors)")
|
|
738
790
|
print("\(tag) angleDegreesClickColors: \(angleClick)")
|
|
739
791
|
print("\(tag) holdUntilClickColors: \(holdClick)")
|
|
740
|
-
print("\(tag)
|
|
792
|
+
print("\(tag) extractedDataLanguage: \(extractedDataLanguage)")
|
|
741
793
|
print("\(tag) enableNfc: \(enableNfc)")
|
|
742
794
|
print("\(tag) enableQr: \(enableQr)")
|
|
743
795
|
print("\(tag) clear: \(clear)")
|
|
744
796
|
print("\(tag) blockLoaderCustomProperties: \(parsedBlockLoaderCustomProperties)")
|
|
797
|
+
print("\(tag) stepperType: \(stepperType)")
|
|
798
|
+
print("\(tag) rangeStart: \(rangeStart)")
|
|
799
|
+
print("\(tag) rangeEnd: \(rangeEnd)")
|
|
800
|
+
print("\(tag) stepperTitle: \(stepperTitle)")
|
|
801
|
+
print("\(tag) showCountDown: \(showCountDown)")
|
|
802
|
+
print("\(tag) validationStyle: \(validationStyle)")
|
|
803
|
+
print("\(tag) stepperTitleColor: \(stepperTitleColor)")
|
|
804
|
+
print("\(tag) howToCapturePassportVideo: \(howToCapturePassportVideo)")
|
|
805
|
+
print("\(tag) howToCaptureIDVideo: \(howToCaptureIDVideo)")
|
|
806
|
+
print("\(tag) howToCaptureFaceVideo: \(howToCaptureFaceVideo)")
|
|
807
|
+
print("\(tag) clickFontWeight: \(clickFontWeight)")
|
|
808
|
+
print("\(tag) hideBlockLoader: \(hideBlockLoader)")
|
|
809
|
+
print("\(tag) hideWrapUp: \(hideWrapUp)")
|
|
810
|
+
print("\(tag) localMrzScan: \(localMrzScan)")
|
|
745
811
|
print("\(tag) =================================")
|
|
746
812
|
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
let validationStyleType: String = {
|
|
816
|
+
let style = validationStyle ?? ""
|
|
817
|
+
if style == "Message" {
|
|
818
|
+
return ValidationStyle.Message
|
|
819
|
+
} else if style == "Asterisk" {
|
|
820
|
+
return ValidationStyle.Asterisk
|
|
821
|
+
} else {
|
|
822
|
+
return ValidationStyle.Message
|
|
823
|
+
}
|
|
824
|
+
}()
|
|
825
|
+
|
|
826
|
+
let clickFontWeightType: String = {
|
|
827
|
+
switch (clickFontWeight ?? "") {
|
|
828
|
+
case "Normal":
|
|
829
|
+
return ClickFontWeight.Normal
|
|
830
|
+
case "Medium":
|
|
831
|
+
return ClickFontWeight.Medium
|
|
832
|
+
case "Bold":
|
|
833
|
+
return ClickFontWeight.Bold
|
|
834
|
+
case "SemiBold":
|
|
835
|
+
return ClickFontWeight.SemiBold
|
|
836
|
+
case "ExtraBold":
|
|
837
|
+
return ClickFontWeight.ExtraBold
|
|
838
|
+
default:
|
|
839
|
+
return ClickFontWeight.Normal
|
|
840
|
+
}
|
|
841
|
+
}()
|
|
842
|
+
|
|
747
843
|
let bType: BackgroundType = {
|
|
748
844
|
switch backgroundType.lowercased() {
|
|
749
845
|
case "image":
|
|
@@ -755,6 +851,17 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
755
851
|
}
|
|
756
852
|
}()
|
|
757
853
|
|
|
854
|
+
let sType: StepperType = {
|
|
855
|
+
switch stepperType {
|
|
856
|
+
case "Normal":
|
|
857
|
+
return .normal
|
|
858
|
+
case "PercentageBased":
|
|
859
|
+
return .percentageBased
|
|
860
|
+
default:
|
|
861
|
+
return .normal
|
|
862
|
+
}
|
|
863
|
+
}()
|
|
864
|
+
|
|
758
865
|
var backgroundColor: BackgroundStyle? = nil
|
|
759
866
|
var clickColor: BackgroundStyle? = nil
|
|
760
867
|
|
|
@@ -792,17 +899,31 @@ class NativeAssentifySdk: RCTEventEmitter ,AssentifySdkDelegate , SubmitDataDel
|
|
|
792
899
|
accentColor: accentColor,
|
|
793
900
|
backgroundColor: backgroundColor,
|
|
794
901
|
clickColor: clickColor,
|
|
795
|
-
|
|
902
|
+
stepperType: sType,
|
|
903
|
+
rangeStart: rangeStart.intValue,
|
|
904
|
+
rangeEnd:rangeEnd.intValue,
|
|
905
|
+
stepperTitle:stepperTitle,
|
|
906
|
+
extractedDataLanguage: extractedDataLanguage,
|
|
796
907
|
enableNfc: enableNfc,
|
|
797
908
|
enableQr: enableQr,
|
|
798
|
-
|
|
909
|
+
showCountDown:showCountDown,
|
|
910
|
+
blockLoaderCustomProperties: parsedBlockLoaderCustomProperties,
|
|
911
|
+
validationStyle : validationStyleType ?? ValidationStyle.Message,
|
|
912
|
+
stepperTitleColor : stepperTitleColor ?? "",
|
|
913
|
+
howToCapturePassportVideo : howToCapturePassportVideo ?? "",
|
|
914
|
+
howToCaptureIDVideo : howToCaptureIDVideo ?? "",
|
|
915
|
+
howToCaptureFaceVideo : howToCaptureFaceVideo ?? "",
|
|
916
|
+
clickFontWeight : clickFontWeightType ?? ClickFontWeight.Normal,
|
|
917
|
+
hideBlockLoader : hideBlockLoader,
|
|
918
|
+
hideWrapUp : hideWrapUp,
|
|
919
|
+
localMrzScan:localMrzScan
|
|
799
920
|
)
|
|
800
921
|
DispatchQueue.main.async {
|
|
801
|
-
|
|
922
|
+
|
|
802
923
|
if(clear){
|
|
803
924
|
self.assentifySdk!.clearFlow();
|
|
804
925
|
}
|
|
805
|
-
|
|
926
|
+
|
|
806
927
|
if let currentViewController = UIApplication.shared.keyWindow?.rootViewController {
|
|
807
928
|
|
|
808
929
|
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
|
|