assentify-sdk-react-native 1.0.0-Beta.4 → 1.0.0-Beta.41
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 +124 -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 +67 -6
- package/android/src/main/java/com/assentifysdk/ScanPassportActivity.kt +53 -1
- 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 +93 -37
- package/ios/View/OtherController.swift +33 -33
- package/ios/View/PassportController.swift +84 -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 +36 -5
- 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 +34 -3
- 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 +63 -10
- 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
|
@@ -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
|
|