@smile_identity/react-native 10.2.3 → 10.2.4

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.
Files changed (139) hide show
  1. package/android/build.gradle +4 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/smileidentity/react/Mapper.kt +19 -2
  4. package/android/src/main/java/com/smileidentity/react/fragments/SmileCaptureFragment.kt +56 -0
  5. package/android/src/main/java/com/smileidentity/react/utils/ReactUtils.kt +16 -0
  6. package/android/src/main/java/com/smileidentity/react/viewmanagers/BaseSmileIDViewManager.kt +130 -0
  7. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDBiometricKYCViewManager.kt +22 -46
  8. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDConsentViewManager.kt +27 -52
  9. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDDocumentCaptureViewManager.kt +15 -40
  10. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDDocumentVerificationViewManager.kt +23 -49
  11. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDEnhancedDocumentVerificationViewManager.kt +28 -47
  12. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDSmartSelfieAuthenticationEnhancedViewManager.kt +12 -37
  13. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDSmartSelfieAuthenticationViewManager.kt +16 -40
  14. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDSmartSelfieCaptureViewManager.kt +15 -38
  15. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDSmartSelfieEnrollmentEnhancedViewManager.kt +13 -38
  16. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDSmartSelfieEnrollmentViewManager.kt +15 -44
  17. package/android/src/main/java/com/smileidentity/react/views/SmileIDBiometricKYCView.kt +7 -0
  18. package/android/src/main/java/com/smileidentity/react/views/SmileIDEnhancedDocumentVerificationView.kt +8 -0
  19. package/android/src/main/java/com/smileidentity/react/views/SmileIDSmartSelfieCaptureView.kt +38 -25
  20. package/android/src/main/java/com/smileidentity/react/views/SmileIDSmartSelfieEnrollmentEnhancedView.kt +29 -21
  21. package/android/src/main/java/com/smileidentity/react/views/SmileIDSmartSelfieEnrollmentView.kt +35 -28
  22. package/android/src/main/java/com/smileidentity/react/views/SmileIDView.kt +11 -10
  23. package/android/src/main/res/values/colors.xml +14 -0
  24. package/android/src/main/res/values/strings.xml +91 -0
  25. package/ios/RNDelegates/SmileIDUIViewDelegate.swift +2 -0
  26. package/ios/RNSmileID.swift +470 -471
  27. package/ios/Utils/FileUtils.swift +17 -17
  28. package/ios/Utils/SmileIDDictExt.swift +14 -9
  29. package/ios/View/BaseSmileIDView.swift +6 -5
  30. package/ios/View/SmileIDBiometricKYCView.swift +54 -54
  31. package/ios/View/SmileIDConsentView.swift +2 -1
  32. package/ios/View/SmileIDDocumentCaptureView.swift +64 -64
  33. package/ios/View/SmileIDDocumentVerificationView.swift +51 -51
  34. package/ios/View/SmileIDEnhancedDocumentVerificationView.swift +51 -50
  35. package/ios/View/SmileIDSmartSelfieAuthEnhancedView.swift +34 -33
  36. package/ios/View/SmileIDSmartSelfieAuthView.swift +35 -34
  37. package/ios/View/SmileIDSmartSelfieCaptureView.swift +55 -55
  38. package/ios/View/SmileIDSmartSelfieEnrollmentEnhancedView.swift +35 -34
  39. package/ios/View/SmileIDSmartSelfieEnrollmentView.swift +37 -36
  40. package/ios/ViewManagers/SmileIDBaseViewManager.swift +22 -5
  41. package/ios/ViewManagers/SmileIDBiometricKYCViewManager.m +4 -1
  42. package/ios/ViewManagers/SmileIDBiometricKYCViewManager.swift +2 -2
  43. package/ios/ViewManagers/SmileIDConsentViewManager.m +4 -1
  44. package/ios/ViewManagers/SmileIDConsentViewManager.swift +2 -2
  45. package/ios/ViewManagers/SmileIDDocumentCaptureViewManager.m +4 -1
  46. package/ios/ViewManagers/SmileIDDocumentCaptureViewManager.swift +19 -19
  47. package/ios/ViewManagers/SmileIDDocumentVerificationViewManager.m +4 -1
  48. package/ios/ViewManagers/SmileIDDocumentVerificationViewManager.swift +40 -40
  49. package/ios/ViewManagers/SmileIDEnhancedDocumentVerificationViewManager.m +4 -1
  50. package/ios/ViewManagers/SmileIDEnhancedDocumentVerificationViewManager.swift +40 -40
  51. package/ios/ViewManagers/SmileIDSmartSelfieAuthenticationEnhancedViewManager.m +4 -1
  52. package/ios/ViewManagers/SmileIDSmartSelfieAuthenticationEnhancedViewManager.swift +16 -16
  53. package/ios/ViewManagers/SmileIDSmartSelfieAuthenticationViewManager.m +4 -1
  54. package/ios/ViewManagers/SmileIDSmartSelfieAuthenticationViewManager.swift +20 -20
  55. package/ios/ViewManagers/SmileIDSmartSelfieCaptureViewManager.m +4 -1
  56. package/ios/ViewManagers/SmileIDSmartSelfieCaptureViewManager.swift +27 -26
  57. package/ios/ViewManagers/SmileIDSmartSelfieEnrollmentEnhancedViewManager.m +4 -1
  58. package/ios/ViewManagers/SmileIDSmartSelfieEnrollmentEnhancedViewManager.swift +16 -16
  59. package/ios/ViewManagers/SmileIDSmartSelfieEnrollmentViewManager.m +4 -1
  60. package/ios/ViewManagers/SmileIDSmartSelfieEnrollmentViewManager.swift +20 -20
  61. package/ios/ViewModels/SmileIDProductModel.swift +5 -5
  62. package/lib/commonjs/SmileIDBiometricKYCView.js +18 -29
  63. package/lib/commonjs/SmileIDBiometricKYCView.js.map +1 -1
  64. package/lib/commonjs/SmileIDConsentView.js +9 -29
  65. package/lib/commonjs/SmileIDConsentView.js.map +1 -1
  66. package/lib/commonjs/SmileIDDocumentCaptureView.js +9 -29
  67. package/lib/commonjs/SmileIDDocumentCaptureView.js.map +1 -1
  68. package/lib/commonjs/SmileIDDocumentVerificationView.js +9 -29
  69. package/lib/commonjs/SmileIDDocumentVerificationView.js.map +1 -1
  70. package/lib/commonjs/SmileIDEnhancedDocumentVerificationView.js +17 -28
  71. package/lib/commonjs/SmileIDEnhancedDocumentVerificationView.js.map +1 -1
  72. package/lib/commonjs/SmileIDSmartSelfieAuthenticationEnhancedView.js +9 -29
  73. package/lib/commonjs/SmileIDSmartSelfieAuthenticationEnhancedView.js.map +1 -1
  74. package/lib/commonjs/SmileIDSmartSelfieAuthenticationView.js +9 -29
  75. package/lib/commonjs/SmileIDSmartSelfieAuthenticationView.js.map +1 -1
  76. package/lib/commonjs/SmileIDSmartSelfieCaptureView.js +9 -29
  77. package/lib/commonjs/SmileIDSmartSelfieCaptureView.js.map +1 -1
  78. package/lib/commonjs/SmileIDSmartSelfieEnrollmentEnhancedView.js +9 -29
  79. package/lib/commonjs/SmileIDSmartSelfieEnrollmentEnhancedView.js.map +1 -1
  80. package/lib/commonjs/SmileIDSmartSelfieEnrollmentView.js +9 -29
  81. package/lib/commonjs/SmileIDSmartSelfieEnrollmentView.js.map +1 -1
  82. package/lib/commonjs/useSmileIDView.js +65 -0
  83. package/lib/commonjs/useSmileIDView.js.map +1 -0
  84. package/lib/module/SmileIDBiometricKYCView.js +18 -26
  85. package/lib/module/SmileIDBiometricKYCView.js.map +1 -1
  86. package/lib/module/SmileIDConsentView.js +9 -26
  87. package/lib/module/SmileIDConsentView.js.map +1 -1
  88. package/lib/module/SmileIDDocumentCaptureView.js +9 -26
  89. package/lib/module/SmileIDDocumentCaptureView.js.map +1 -1
  90. package/lib/module/SmileIDDocumentVerificationView.js +9 -26
  91. package/lib/module/SmileIDDocumentVerificationView.js.map +1 -1
  92. package/lib/module/SmileIDEnhancedDocumentVerificationView.js +17 -25
  93. package/lib/module/SmileIDEnhancedDocumentVerificationView.js.map +1 -1
  94. package/lib/module/SmileIDSmartSelfieAuthenticationEnhancedView.js +9 -26
  95. package/lib/module/SmileIDSmartSelfieAuthenticationEnhancedView.js.map +1 -1
  96. package/lib/module/SmileIDSmartSelfieAuthenticationView.js +9 -26
  97. package/lib/module/SmileIDSmartSelfieAuthenticationView.js.map +1 -1
  98. package/lib/module/SmileIDSmartSelfieCaptureView.js +9 -26
  99. package/lib/module/SmileIDSmartSelfieCaptureView.js.map +1 -1
  100. package/lib/module/SmileIDSmartSelfieEnrollmentEnhancedView.js +9 -26
  101. package/lib/module/SmileIDSmartSelfieEnrollmentEnhancedView.js.map +1 -1
  102. package/lib/module/SmileIDSmartSelfieEnrollmentView.js +9 -26
  103. package/lib/module/SmileIDSmartSelfieEnrollmentView.js.map +1 -1
  104. package/lib/module/useSmileIDView.js +58 -0
  105. package/lib/module/useSmileIDView.js.map +1 -0
  106. package/lib/typescript/SmileIDBiometricKYCView.d.ts +3 -6
  107. package/lib/typescript/SmileIDBiometricKYCView.d.ts.map +1 -1
  108. package/lib/typescript/SmileIDConsentView.d.ts +3 -6
  109. package/lib/typescript/SmileIDConsentView.d.ts.map +1 -1
  110. package/lib/typescript/SmileIDDocumentCaptureView.d.ts +3 -6
  111. package/lib/typescript/SmileIDDocumentCaptureView.d.ts.map +1 -1
  112. package/lib/typescript/SmileIDDocumentVerificationView.d.ts +3 -6
  113. package/lib/typescript/SmileIDDocumentVerificationView.d.ts.map +1 -1
  114. package/lib/typescript/SmileIDEnhancedDocumentVerificationView.d.ts +3 -6
  115. package/lib/typescript/SmileIDEnhancedDocumentVerificationView.d.ts.map +1 -1
  116. package/lib/typescript/SmileIDSmartSelfieAuthenticationEnhancedView.d.ts +3 -6
  117. package/lib/typescript/SmileIDSmartSelfieAuthenticationEnhancedView.d.ts.map +1 -1
  118. package/lib/typescript/SmileIDSmartSelfieAuthenticationView.d.ts +3 -6
  119. package/lib/typescript/SmileIDSmartSelfieAuthenticationView.d.ts.map +1 -1
  120. package/lib/typescript/SmileIDSmartSelfieCaptureView.d.ts +3 -6
  121. package/lib/typescript/SmileIDSmartSelfieCaptureView.d.ts.map +1 -1
  122. package/lib/typescript/SmileIDSmartSelfieEnrollmentEnhancedView.d.ts +3 -6
  123. package/lib/typescript/SmileIDSmartSelfieEnrollmentEnhancedView.d.ts.map +1 -1
  124. package/lib/typescript/SmileIDSmartSelfieEnrollmentView.d.ts +3 -6
  125. package/lib/typescript/SmileIDSmartSelfieEnrollmentView.d.ts.map +1 -1
  126. package/lib/typescript/useSmileIDView.d.ts +12 -0
  127. package/lib/typescript/useSmileIDView.d.ts.map +1 -0
  128. package/package.json +1 -1
  129. package/src/SmileIDBiometricKYCView.tsx +14 -30
  130. package/src/SmileIDConsentView.tsx +7 -30
  131. package/src/SmileIDDocumentCaptureView.tsx +9 -33
  132. package/src/SmileIDDocumentVerificationView.tsx +9 -36
  133. package/src/SmileIDEnhancedDocumentVerificationView.tsx +23 -35
  134. package/src/SmileIDSmartSelfieAuthenticationEnhancedView.tsx +17 -36
  135. package/src/SmileIDSmartSelfieAuthenticationView.tsx +10 -37
  136. package/src/SmileIDSmartSelfieCaptureView.tsx +9 -33
  137. package/src/SmileIDSmartSelfieEnrollmentEnhancedView.tsx +14 -36
  138. package/src/SmileIDSmartSelfieEnrollmentView.tsx +10 -37
  139. package/src/useSmileIDView.tsx +88 -0
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDConsentViewManager, RCTViewManager)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
6
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
7
10
  @end
@@ -6,10 +6,10 @@ import SwiftUI
6
6
  @objc(SmileIDConsentViewManager)
7
7
  class SmileIDConsentViewManager: SmileIDBaseViewManager {
8
8
  override func getView() -> UIView {
9
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDConsentView(product: self.product)),product:self.product)
9
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDConsentView(product: product, smileIDUIViewDelegate: self)), product: product)
10
10
  }
11
11
 
12
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
12
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
13
13
  /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
14
14
  */
15
15
  DispatchQueue.main.async {
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDDocumentCaptureViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -4,26 +4,26 @@ import SwiftUI
4
4
 
5
5
  @objc(SmileIDDocumentCaptureViewManager)
6
6
  class SmileIDDocumentCaptureViewManager: SmileIDBaseViewManager {
7
- override func getView() -> UIView {
8
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDDocumentCaptureView(product: self.product)), product: self.product)
9
- }
7
+ override func getView() -> UIView {
8
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDDocumentCaptureView(product: product, smileIDUIViewDelegate: self)), product: product)
9
+ }
10
10
 
11
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
12
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
11
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
12
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
13
  */
14
- DispatchQueue.main.async {
15
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
- self.product.userId = params["userId"] as? String
18
- self.product.jobId = params["jobId"] as? String
19
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
20
- self.product.front = params["isDocumentFrontSide"] as? Bool ?? true
21
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
22
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
23
- self.product.showConfirmation = params["showConfirmation"] as? Bool ?? true
24
- self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
25
- self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
26
- }
14
+ DispatchQueue.main.async {
15
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
+ self.product.userId = params["userId"] as? String
18
+ self.product.jobId = params["jobId"] as? String
19
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
20
+ self.product.front = params["isDocumentFrontSide"] as? Bool ?? true
21
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
22
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
23
+ self.product.showConfirmation = params["showConfirmation"] as? Bool ?? true
24
+ self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
25
+ self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
26
+ }
27
+ }
27
28
  }
28
- }
29
29
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDDocumentVerificationViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -5,46 +5,46 @@ import SwiftUI
5
5
 
6
6
  @objc(SmileIDDocumentVerificationViewManager)
7
7
  class SmileIDDocumentVerificationViewManager: SmileIDBaseViewManager {
8
- override func getView() -> UIView {
9
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDDocumentVerificationView(product: self.product)),product:self.product)
10
- }
11
-
12
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
13
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
14
- */
15
- DispatchQueue.main.async {
16
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
17
- let onResult = params["onResult"] as? RCTDirectEventBlock
18
- guard let countryCode = params["countryCode"] as? String else {
19
- onResult?(["error": SmileIDError.unknown("countryCode is required to run Enhanced Document Verification")])
20
- return
21
- }
22
-
23
- var bypassSelfieCaptureWithFilePath: URL?
24
- if let filePath = params["bypassSelfieCaptureWithFile"] as? String {
25
- if !filePath.isValidUrl() {
26
- onResult?(["error": SmileIDError.unknown("bypassSelfieCaptureWithFile must be a valid file url")])
27
- return
28
- }
29
- bypassSelfieCaptureWithFilePath = URL(string: filePath)
8
+ override func getView() -> UIView {
9
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDDocumentVerificationView(product: product, smileIDUIViewDelegate: self)), product: product)
10
+ }
11
+
12
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
13
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
14
+ */
15
+ DispatchQueue.main.async {
16
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
17
+ let onResult = params["onResult"] as? RCTDirectEventBlock
18
+ guard let countryCode = params["countryCode"] as? String else {
19
+ onResult?(["error": SmileIDError.unknown("countryCode is required to run Enhanced Document Verification")])
20
+ return
21
+ }
22
+
23
+ var bypassSelfieCaptureWithFilePath: URL?
24
+ if let filePath = params["bypassSelfieCaptureWithFile"] as? String {
25
+ if !filePath.isValidUrl() {
26
+ onResult?(["error": SmileIDError.unknown("bypassSelfieCaptureWithFile must be a valid file url")])
27
+ return
28
+ }
29
+ bypassSelfieCaptureWithFilePath = URL(string: filePath)
30
+ }
31
+
32
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
33
+ self.product.userId = params["userId"] as? String
34
+ self.product.jobId = params["jobId"] as? String
35
+ self.product.countryCode = countryCode
36
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
37
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
38
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
39
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
40
+ self.product.documentType = params["documentType"] as? String
41
+ self.product.idAspectRatio = params["idAspectRatio"] as? Double
42
+ self.product.bypassSelfieCaptureWithFilePath = bypassSelfieCaptureWithFilePath
43
+ self.product.captureBothSides = params["captureBothSides"] as? Bool ?? true
44
+ self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
45
+ self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
46
+ self.product.onResult = params["onResult"] as? RCTDirectEventBlock
47
+ }
30
48
  }
31
-
32
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
33
- self.product.userId = params["userId"] as? String
34
- self.product.jobId = params["jobId"] as? String
35
- self.product.countryCode = countryCode
36
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
37
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
38
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
39
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
40
- self.product.documentType = params["documentType"] as? String
41
- self.product.idAspectRatio = params["idAspectRatio"] as? Double
42
- self.product.bypassSelfieCaptureWithFilePath = bypassSelfieCaptureWithFilePath
43
- self.product.captureBothSides = params["captureBothSides"] as? Bool ?? true
44
- self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
45
- self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
46
- self.product.onResult = params["onResult"] as? RCTDirectEventBlock
47
- }
48
49
  }
49
- }
50
50
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDEnhancedDocumentVerificationViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -5,46 +5,46 @@ import SwiftUI
5
5
 
6
6
  @objc(SmileIDEnhancedDocumentVerificationViewManager)
7
7
  class SmileIDEnhancedDocumentVerificationViewManager: SmileIDBaseViewManager {
8
- override func getView() -> UIView {
9
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDEnhancedDocumentVerificationView(product: self.product)),product:self.product)
10
- }
11
-
12
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
13
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
14
- */
15
- DispatchQueue.main.async {
16
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
17
- let onResult = params["onResult"] as? RCTDirectEventBlock
18
- guard let countryCode = params["countryCode"] as? String else {
19
- onResult?(["error": SmileIDError.unknown("countryCode is required to run Enhanced Document Verification")])
20
- return
21
- }
22
-
23
- var bypassSelfieCaptureWithFilePath: URL?
24
- if let filePath = params["bypassSelfieCaptureWithFile"] as? String {
25
- if !filePath.isValidUrl() {
26
- onResult?(["error": SmileIDError.unknown("bypassSelfieCaptureWithFile must be a valid file url")])
27
- return
28
- }
29
- bypassSelfieCaptureWithFilePath = URL(string: filePath)
8
+ override func getView() -> UIView {
9
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDEnhancedDocumentVerificationView(product: product, smileIDUIViewDelegate: self)), product: product)
10
+ }
11
+
12
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
13
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
14
+ */
15
+ DispatchQueue.main.async {
16
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
17
+ let onResult = params["onResult"] as? RCTDirectEventBlock
18
+ guard let countryCode = params["countryCode"] as? String else {
19
+ onResult?(["error": SmileIDError.unknown("countryCode is required to run Enhanced Document Verification")])
20
+ return
21
+ }
22
+
23
+ var bypassSelfieCaptureWithFilePath: URL?
24
+ if let filePath = params["bypassSelfieCaptureWithFile"] as? String {
25
+ if !filePath.isValidUrl() {
26
+ onResult?(["error": SmileIDError.unknown("bypassSelfieCaptureWithFile must be a valid file url")])
27
+ return
28
+ }
29
+ bypassSelfieCaptureWithFilePath = URL(string: filePath)
30
+ }
31
+
32
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
33
+ self.product.userId = params["userId"] as? String
34
+ self.product.jobId = params["jobId"] as? String
35
+ self.product.countryCode = countryCode
36
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
37
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
38
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
39
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
40
+ self.product.documentType = params["documentType"] as? String
41
+ self.product.idAspectRatio = params["idAspectRatio"] as? Double
42
+ self.product.bypassSelfieCaptureWithFilePath = bypassSelfieCaptureWithFilePath
43
+ self.product.captureBothSides = params["captureBothSides"] as? Bool ?? true
44
+ self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
45
+ self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
46
+ self.product.onResult = params["onResult"] as? RCTDirectEventBlock
47
+ }
30
48
  }
31
-
32
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
33
- self.product.userId = params["userId"] as? String
34
- self.product.jobId = params["jobId"] as? String
35
- self.product.countryCode = countryCode
36
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
37
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
38
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
39
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
40
- self.product.documentType = params["documentType"] as? String
41
- self.product.idAspectRatio = params["idAspectRatio"] as? Double
42
- self.product.bypassSelfieCaptureWithFilePath = bypassSelfieCaptureWithFilePath
43
- self.product.captureBothSides = params["captureBothSides"] as? Bool ?? true
44
- self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
45
- self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
46
- self.product.onResult = params["onResult"] as? RCTDirectEventBlock
47
- }
48
49
  }
49
- }
50
50
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDSmartSelfieAuthenticationEnhancedViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -4,22 +4,22 @@ import SwiftUI
4
4
 
5
5
  @objc(SmileIDSmartSelfieAuthenticationEnhancedViewManager)
6
6
  class SmileIDSmartSelfieAuthenticationEnhancedViewManager: SmileIDBaseViewManager {
7
- override func getView() -> UIView {
8
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieAuthEnhancedView(product: self.product)),product:self.product)
9
- }
7
+ override func getView() -> UIView {
8
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieAuthEnhancedView(product: product, smileIDUIViewDelegate: self)), product: product)
9
+ }
10
10
 
11
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
12
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
- */
14
- DispatchQueue.main.async {
15
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
- self.product.userId = params["userId"] as? String
18
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
19
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
20
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
21
- self.product.onResult = params["onResult"] as? RCTDirectEventBlock
22
- }
11
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
12
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
+ */
14
+ DispatchQueue.main.async {
15
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
+ self.product.userId = params["userId"] as? String
18
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
19
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
20
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
21
+ self.product.onResult = params["onResult"] as? RCTDirectEventBlock
22
+ }
23
+ }
23
24
  }
24
- }
25
25
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDSmartSelfieAuthenticationViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -4,25 +4,25 @@ import SwiftUI
4
4
 
5
5
  @objc(SmileIDSmartSelfieAuthenticationViewManager)
6
6
  class SmileIDSmartSelfieAuthenticationViewManager: SmileIDBaseViewManager {
7
- override func getView() -> UIView {
8
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieAuthView(product: self.product)),product:self.product)
9
- }
10
-
11
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
12
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
- */
14
- DispatchQueue.main.async {
15
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
- self.product.userId = params["userId"] as? String
18
- self.product.jobId = params["jobId"] as? String
19
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
20
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
21
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
22
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
23
- self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
24
- self.product.onResult = params["onResult"] as? RCTDirectEventBlock
25
- }
7
+ override func getView() -> UIView {
8
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieAuthView(product: product, smileIDUIViewDelegate: self)), product: product)
9
+ }
10
+
11
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
12
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
+ */
14
+ DispatchQueue.main.async {
15
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
+ self.product.userId = params["userId"] as? String
18
+ self.product.jobId = params["jobId"] as? String
19
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
20
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
21
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
22
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
23
+ self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
24
+ self.product.onResult = params["onResult"] as? RCTDirectEventBlock
25
+ }
26
+ }
26
27
  }
27
- }
28
28
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDSmartSelfieCaptureViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -1,36 +1,37 @@
1
1
  import Foundation
2
2
  import React
3
- import SwiftUI
4
3
  import SmileID
4
+ import SwiftUI
5
5
 
6
6
  @objc(SmileIDSmartSelfieCaptureViewManager)
7
7
  class SmileIDSmartSelfieCaptureViewManager: SmileIDBaseViewManager {
8
- override func getView() -> UIView {
9
- BaseSmileIDView(frame: .zero, contentView: AnyView(
10
- SmileIDSmartSelfieCaptureView(
11
- viewModel: SelfieViewModel(isEnroll: false,
12
- userId: self.product.userId ?? generateUserId(),
13
- jobId: self.product.jobId ?? generateJobId(),
14
- allowNewEnroll: false,
15
- skipApiSubmission: true,
16
- extraPartnerParams: [:],
17
- localMetadata: LocalMetadata()), product: self.product)),
18
- product: self.product)
19
- }
8
+ override func getView() -> UIView {
9
+ BaseSmileIDView(frame: .zero, contentView: AnyView(
10
+ SmileIDSmartSelfieCaptureView(
11
+ viewModel: SelfieViewModel(isEnroll: false,
12
+ userId: product.userId ?? generateUserId(),
13
+ jobId: product.jobId ?? generateJobId(),
14
+ allowNewEnroll: false,
15
+ skipApiSubmission: true,
16
+ extraPartnerParams: [:],
17
+ localMetadata: LocalMetadata()), product: product, smileIDUIViewDelegate: self
18
+ )),
19
+ product: product)
20
+ }
20
21
 
21
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
22
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
22
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
23
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
23
24
  */
24
- DispatchQueue.main.async {
25
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
26
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
27
- self.product.userId = params["userId"] as? String
28
- self.product.jobId = params["jobId"] as? String
29
- self.product.showConfirmation = params["showConfirmation"] as? Bool ?? true
30
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
31
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
32
- self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
33
- }
25
+ DispatchQueue.main.async {
26
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
27
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
28
+ self.product.userId = params["userId"] as? String
29
+ self.product.jobId = params["jobId"] as? String
30
+ self.product.showConfirmation = params["showConfirmation"] as? Bool ?? true
31
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
32
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
33
+ self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
34
+ }
35
+ }
34
36
  }
35
- }
36
37
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDSmartSelfieEnrollmentEnhancedViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -4,22 +4,22 @@ import SwiftUI
4
4
 
5
5
  @objc(SmileIDSmartSelfieEnrollmentEnhancedViewManager)
6
6
  class SmileIDSmartSelfieEnrollmentEnhancedViewManager: SmileIDBaseViewManager {
7
- override func getView() -> UIView {
8
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieEnrollmentEnhancedView(product: self.product)),product:self.product)
9
- }
7
+ override func getView() -> UIView {
8
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieEnrollmentEnhancedView(product: product, smileIDUIViewDelegate: self)), product: product)
9
+ }
10
10
 
11
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
12
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
- */
14
- DispatchQueue.main.async {
15
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
- self.product.userId = params["userId"] as? String
18
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
19
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
20
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
21
- self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
22
- }
11
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
12
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
+ */
14
+ DispatchQueue.main.async {
15
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
+ self.product.userId = params["userId"] as? String
18
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
19
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
20
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
21
+ self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
22
+ }
23
+ }
23
24
  }
24
- }
25
25
  }
@@ -2,6 +2,9 @@
2
2
  #import <React/RCTViewManager.h>
3
3
 
4
4
  @interface RCT_EXTERN_MODULE(SmileIDSmartSelfieEnrollmentViewManager, RCTViewManager)
5
- RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node params:(NSDictionary *)params)
5
+ RCT_EXTERN_METHOD(setParams:(nonnull NSNumber *)node
6
+ commandId:(nonnull NSNumber *)commandId
7
+ params:(nonnull NSDictionary *)params)
8
+ RCT_EXTERN_METHOD(create:(nonnull NSNumber *)node params:(NSDictionary *)params)
6
9
  RCT_EXPORT_VIEW_PROPERTY(onResult, RCTBubblingEventBlock);
7
10
  @end
@@ -4,25 +4,25 @@ import SwiftUI
4
4
 
5
5
  @objc(SmileIDSmartSelfieEnrollmentViewManager)
6
6
  class SmileIDSmartSelfieEnrollmentViewManager: SmileIDBaseViewManager {
7
- override func getView() -> UIView {
8
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieEnrollmentView(product: self.product)),product:self.product)
9
- }
10
-
11
- @objc func setParams(_ node: NSNumber, params: NSDictionary) {
12
- /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
- */
14
- DispatchQueue.main.async {
15
- if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
- self.product.userId = params["userId"] as? String
18
- self.product.jobId = params["jobId"] as? String
19
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
20
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
21
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
22
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
23
- self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
24
- self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
25
- }
7
+ override func getView() -> UIView {
8
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDSmartSelfieEnrollmentView(product: product, smileIDUIViewDelegate: self)), product: product)
9
+ }
10
+
11
+ @objc func setParams(_ node: NSNumber, commandId _: NSNumber, params: NSDictionary) {
12
+ /* UI Updates on the Main Thread:async ensures that the UI update is scheduled to run on the next cycle of the run loop, preventing any potential blocking of the UI if the update were to take a noticeable amount of time
13
+ */
14
+ DispatchQueue.main.async {
15
+ if let component = self.bridge.uiManager.view(forReactTag: node) as? BaseSmileIDView {
16
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
17
+ self.product.userId = params["userId"] as? String
18
+ self.product.jobId = params["jobId"] as? String
19
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
20
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
21
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
22
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
23
+ self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
24
+ self.product.onResult = params["onResult"] as? RCTBubblingEventBlock
25
+ }
26
+ }
26
27
  }
27
- }
28
28
  }
@@ -2,11 +2,11 @@ import Combine
2
2
  import Foundation
3
3
  import SmileID
4
4
 
5
- //We're making this a central place to observe
6
- //changes published after props have been updated
7
- //from react native side the main thing being that
8
- //when views are instantiated we don't have all the props
9
- //also state could change
5
+ // We're making this a central place to observe
6
+ // changes published after props have been updated
7
+ // from react native side the main thing being that
8
+ // when views are instantiated we don't have all the props
9
+ // also state could change
10
10
  class SmileIDProductModel: ObservableObject {
11
11
  @Published var userId: String?
12
12
  @Published var jobId: String?