@smile_identity/react-native 10.2.4-beta.1 → 10.2.5

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 (70) hide show
  1. package/android/build.gradle +2 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/smileidentity/react/Mapper.kt +1 -1
  4. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDBiometricKYCViewManager.kt +1 -0
  5. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDDocumentVerificationViewManager.kt +1 -0
  6. package/android/src/main/java/com/smileidentity/react/viewmanagers/SmileIDEnhancedDocumentVerificationViewManager.kt +1 -0
  7. package/android/src/main/java/com/smileidentity/react/views/SmileIDBiometricKYCView.kt +2 -0
  8. package/android/src/main/java/com/smileidentity/react/views/SmileIDDocumentVerificationView.kt +2 -0
  9. package/android/src/main/java/com/smileidentity/react/views/SmileIDEnhancedDocumentVerificationView.kt +2 -0
  10. package/ios/RNDelegates/SmileIDUIViewDelegate.swift +2 -0
  11. package/ios/RNSmileID.swift +482 -471
  12. package/ios/Utils/FileUtils.swift +17 -17
  13. package/ios/Utils/SmileIDDictExt.swift +29 -9
  14. package/ios/Utils/SmileIDUtils.swift +9 -0
  15. package/ios/View/BaseSmileIDView.swift +6 -5
  16. package/ios/View/SmileIDBiometricKYCView.swift +56 -54
  17. package/ios/View/SmileIDConsentView.swift +3 -2
  18. package/ios/View/SmileIDDocumentCaptureView.swift +64 -64
  19. package/ios/View/SmileIDDocumentVerificationView.swift +52 -51
  20. package/ios/View/SmileIDEnhancedDocumentVerificationView.swift +53 -50
  21. package/ios/View/SmileIDSmartSelfieAuthEnhancedView.swift +34 -33
  22. package/ios/View/SmileIDSmartSelfieAuthView.swift +35 -34
  23. package/ios/View/SmileIDSmartSelfieCaptureView.swift +55 -55
  24. package/ios/View/SmileIDSmartSelfieEnrollmentEnhancedView.swift +35 -34
  25. package/ios/View/SmileIDSmartSelfieEnrollmentView.swift +37 -36
  26. package/ios/ViewManagers/SmileIDBaseViewManager.swift +38 -25
  27. package/ios/ViewManagers/SmileIDBiometricKYCViewManager.swift +30 -24
  28. package/ios/ViewManagers/SmileIDConsentViewManager.swift +2 -2
  29. package/ios/ViewManagers/SmileIDDocumentCaptureViewManager.swift +19 -19
  30. package/ios/ViewManagers/SmileIDDocumentVerificationViewManager.swift +41 -40
  31. package/ios/ViewManagers/SmileIDEnhancedDocumentVerificationViewManager.swift +47 -40
  32. package/ios/ViewManagers/SmileIDSmartSelfieAuthenticationEnhancedViewManager.swift +16 -16
  33. package/ios/ViewManagers/SmileIDSmartSelfieAuthenticationViewManager.swift +20 -20
  34. package/ios/ViewManagers/SmileIDSmartSelfieCaptureViewManager.swift +27 -26
  35. package/ios/ViewManagers/SmileIDSmartSelfieEnrollmentEnhancedViewManager.swift +16 -16
  36. package/ios/ViewManagers/SmileIDSmartSelfieEnrollmentViewManager.swift +20 -20
  37. package/ios/ViewModels/SmileIDProductModel.swift +7 -5
  38. package/lib/commonjs/SmileIDBiometricKYCView.js +2 -11
  39. package/lib/commonjs/SmileIDBiometricKYCView.js.map +1 -1
  40. package/lib/commonjs/SmileIDEnhancedDocumentVerificationView.js +2 -11
  41. package/lib/commonjs/SmileIDEnhancedDocumentVerificationView.js.map +1 -1
  42. package/lib/commonjs/index.js.map +1 -1
  43. package/lib/commonjs/types.js +31 -1
  44. package/lib/commonjs/types.js.map +1 -1
  45. package/lib/commonjs/useSmileIDView.js +16 -6
  46. package/lib/commonjs/useSmileIDView.js.map +1 -1
  47. package/lib/module/SmileIDBiometricKYCView.js +2 -11
  48. package/lib/module/SmileIDBiometricKYCView.js.map +1 -1
  49. package/lib/module/SmileIDEnhancedDocumentVerificationView.js +2 -11
  50. package/lib/module/SmileIDEnhancedDocumentVerificationView.js.map +1 -1
  51. package/lib/module/index.js.map +1 -1
  52. package/lib/module/types.js +29 -0
  53. package/lib/module/types.js.map +1 -1
  54. package/lib/module/useSmileIDView.js +17 -7
  55. package/lib/module/useSmileIDView.js.map +1 -1
  56. package/lib/typescript/SmileIDBiometricKYCView.d.ts.map +1 -1
  57. package/lib/typescript/SmileIDEnhancedDocumentVerificationView.d.ts +2 -2
  58. package/lib/typescript/SmileIDEnhancedDocumentVerificationView.d.ts.map +1 -1
  59. package/lib/typescript/index.d.ts +2 -2
  60. package/lib/typescript/index.d.ts.map +1 -1
  61. package/lib/typescript/types.d.ts +17 -3
  62. package/lib/typescript/types.d.ts.map +1 -1
  63. package/lib/typescript/useSmileIDView.d.ts.map +1 -1
  64. package/package.json +1 -1
  65. package/react-native-smile-id.podspec +1 -1
  66. package/src/SmileIDBiometricKYCView.tsx +2 -9
  67. package/src/SmileIDEnhancedDocumentVerificationView.tsx +6 -16
  68. package/src/index.tsx +2 -0
  69. package/src/types.ts +62 -3
  70. package/src/useSmileIDView.tsx +17 -9
@@ -5,30 +5,36 @@ import SwiftUI
5
5
 
6
6
  @objc(SmileIDBiometricKYCViewManager)
7
7
  class SmileIDBiometricKYCViewManager: SmileIDBaseViewManager {
8
- override func getView() -> UIView {
9
- BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDBiometricKYCView(product: self.product)),product:self.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 idInfo = params["idInfo"] as? NSDictionary else {
19
- onResult?(["error": SmileIDError.unknown("idInfo is required to run Biometric KYC")])
20
- return
8
+ override func getView() -> UIView {
9
+ BaseSmileIDView(frame: .zero, contentView: AnyView(SmileIDBiometricKYCView(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 idInfo = params["idInfo"] as? NSDictionary else {
19
+ onResult?(["error": SmileIDError.unknown("idInfo is required to run Biometric KYC")])
20
+ return
21
+ }
22
+ guard let consentInformation = params["consentInformation"] as? NSDictionary else {
23
+ onResult?(["error": SmileIDError.unknown("consentInformation is required to run Biometric KYC")])
24
+ return
25
+ }
26
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
27
+ self.product.userId = params["userId"] as? String
28
+ self.product.jobId = params["jobId"] as? String
29
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
30
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
31
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
32
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
33
+ self.product.useStrictMode = params["useStrictMode"] as? Bool ?? false
34
+ self.product.idInfo = idInfo.toIdInfo()
35
+ self.product.consentInformation = consentInformation.toConsentInfo()
36
+ self.product.onResult = onResult
37
+ }
21
38
  }
22
- self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
23
- self.product.userId = params["userId"] as? String
24
- self.product.jobId = params["jobId"] as? String
25
- self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
26
- self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
27
- self.product.showAttribution = params["showAttribution"] as? Bool ?? true
28
- self.product.showInstructions = params["showInstructions"] as? Bool ?? true
29
- self.product.idInfo = idInfo.toIdInfo()
30
- self.product.onResult = onResult
31
- }
32
39
  }
33
- }
34
40
  }
@@ -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, commandId: 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 {
@@ -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, 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
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
  }
@@ -5,46 +5,47 @@ 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, 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)
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.useStrictMode = params["useStrictMode"] as? Bool ?? false
47
+ self.product.onResult = params["onResult"] as? RCTDirectEventBlock
48
+ }
30
49
  }
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
50
  }
49
- }
50
51
  }
@@ -5,46 +5,53 @@ 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, 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)
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
+ guard let consentInformation = params["consentInformation"] as? NSDictionary else {
24
+ onResult?(["error": SmileIDError.unknown("consentInformation is required to run Biometric KYC")])
25
+ return
26
+ }
27
+
28
+ var bypassSelfieCaptureWithFilePath: URL?
29
+ if let filePath = params["bypassSelfieCaptureWithFile"] as? String {
30
+ if !filePath.isValidUrl() {
31
+ onResult?(["error": SmileIDError.unknown("bypassSelfieCaptureWithFile must be a valid file url")])
32
+ return
33
+ }
34
+ bypassSelfieCaptureWithFilePath = URL(string: filePath)
35
+ }
36
+
37
+ self.product.extraPartnerParams = params["extraPartnerParams"] as? [String: String] ?? [:]
38
+ self.product.userId = params["userId"] as? String
39
+ self.product.jobId = params["jobId"] as? String
40
+ self.product.countryCode = countryCode
41
+ self.product.allowAgentMode = params["allowAgentMode"] as? Bool ?? false
42
+ self.product.allowNewEnroll = params["allowNewEnroll"] as? Bool ?? false
43
+ self.product.showAttribution = params["showAttribution"] as? Bool ?? true
44
+ self.product.showInstructions = params["showInstructions"] as? Bool ?? true
45
+ self.product.documentType = params["documentType"] as? String
46
+ self.product.idAspectRatio = params["idAspectRatio"] as? Double
47
+ self.product.bypassSelfieCaptureWithFilePath = bypassSelfieCaptureWithFilePath
48
+ self.product.captureBothSides = params["captureBothSides"] as? Bool ?? true
49
+ self.product.allowGalleryUpload = params["allowGalleryUpload"] as? Bool ?? false
50
+ self.product.skipApiSubmission = params["skipApiSubmission"] as? Bool ?? false
51
+ self.product.useStrictMode = params["useStrictMode"] as? Bool ?? false
52
+ self.product.consentInformation = consentInformation.toConsentInfo()
53
+ self.product.onResult = params["onResult"] as? RCTDirectEventBlock
54
+ }
30
55
  }
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
56
  }
49
- }
50
57
  }
@@ -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, 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
- }
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
  }
@@ -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, 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
- }
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
  }
@@ -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, commandId: 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
  }
@@ -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, 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
- }
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
  }
@@ -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, 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
- }
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?
@@ -27,7 +27,9 @@ class SmileIDProductModel: ObservableObject {
27
27
  @Published var documentType: String?
28
28
  @Published var captureBothSides: Bool = false
29
29
  @Published var allowGalleryUpload: Bool = false
30
+ @Published var useStrictMode: Bool = false
30
31
  @Published var idInfo: IdInfo?
32
+ @Published var consentInformation: ConsentInformation?
31
33
  @Published var bypassSelfieCaptureWithFilePath: URL?
32
34
  @Published var onResult: RCTBubblingEventBlock?
33
35
  }
@@ -9,21 +9,12 @@ var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libra
9
9
  var _useSmileIDView = require("./useSmileIDView");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
- const defaultConsentInfo = {
13
- consentInformation: {
14
- timestamp: new Date().toISOString()
15
- }
16
- };
17
12
  const SmileIDBiometricKYCComponent = (0, _codegenNativeComponent.default)('SmileIDBiometricKYCView');
18
13
  const SmileIDBiometricKYCView = props => {
19
- const mergedProps = {
20
- ...defaultConsentInfo,
21
- ...props
22
- };
23
- const viewRef = (0, _useSmileIDView.useSmileIDView)('SmileIDBiometricKYCView', mergedProps);
14
+ const viewRef = (0, _useSmileIDView.useSmileIDView)('SmileIDBiometricKYCView', props);
24
15
  return /*#__PURE__*/_react.default.createElement(SmileIDBiometricKYCComponent, _extends({
25
16
  ref: viewRef
26
- }, mergedProps));
17
+ }, props));
27
18
  };
28
19
  var _default = exports.default = SmileIDBiometricKYCView;
29
20
  //# sourceMappingURL=SmileIDBiometricKYCView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_codegenNativeComponent","_useSmileIDView","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","defaultConsentInfo","consentInformation","timestamp","Date","toISOString","SmileIDBiometricKYCComponent","codegenNativeComponent","SmileIDBiometricKYCView","props","mergedProps","viewRef","useSmileIDView","createElement","ref","_default","exports"],"sourceRoot":"../../src","sources":["SmileIDBiometricKYCView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAAkD,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAElD,MAAMO,kBAAkB,GAAG;EACzBC,kBAAkB,EAAE;IAClBC,SAAS,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC;EACpC;AACF,CAAC;AAED,MAAMC,4BAA4B,GAChC,IAAAC,+BAAsB,EACpB,yBACF,CAAuC;AAEzC,MAAMC,uBAAsD,GAAIC,KAAK,IAAK;EACxE,MAAMC,WAAW,GAAG;IAAE,GAAGT,kBAAkB;IAAE,GAAGQ;EAAM,CAAC;EACvD,MAAME,OAAO,GAAG,IAAAC,8BAAc,EAAC,yBAAyB,EAAEF,WAAW,CAAC;EAEtE,oBAAO7B,MAAA,CAAAO,OAAA,CAAAyB,aAAA,CAACP,4BAA4B,EAAAjB,QAAA;IAACyB,GAAG,EAAEH;EAAQ,GAAKD,WAAW,CAAG,CAAC;AACxE,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEaoB,uBAAuB","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireDefault","require","_codegenNativeComponent","_useSmileIDView","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","SmileIDBiometricKYCComponent","codegenNativeComponent","SmileIDBiometricKYCView","props","viewRef","useSmileIDView","createElement","ref","_default","exports"],"sourceRoot":"../../src","sources":["SmileIDBiometricKYCView.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,uBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,eAAA,GAAAF,OAAA;AAAkD,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAElD,MAAMO,4BAA4B,GAChC,IAAAC,+BAAsB,EACpB,yBACF,CAAuC;AAEzC,MAAMC,uBAAsD,GAAIC,KAAK,IAAK;EACxE,MAAMC,OAAO,GAAG,IAAAC,8BAAc,EAAC,yBAAyB,EAAEF,KAAK,CAAC;EAEhE,oBAAOvB,MAAA,CAAAO,OAAA,CAAAmB,aAAA,CAACN,4BAA4B,EAAAZ,QAAA;IAACmB,GAAG,EAAEH;EAAQ,GAAKD,KAAK,CAAG,CAAC;AAClE,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEae,uBAAuB","ignoreList":[]}