assentify-sdk-react-native 1.0.0-Beta.4 → 1.0.0-Beta.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/Package.swift +172 -0
  2. package/README.md +120 -32
  3. package/android/build.gradle +1 -6
  4. package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +48 -9
  5. package/android/src/main/java/com/assentifysdk/FlowActivity.kt +75 -7
  6. package/android/src/main/java/com/assentifysdk/ScanIDActivity.kt +5 -4
  7. package/android/src/main/res/layout/activity_scan.xml +45 -57
  8. package/ios/AssentifySdkBaseModule.swift +1 -0
  9. package/ios/NativeAssentifySdk.mm +19 -2
  10. package/ios/NativeAssentifySdk.swift +151 -25
  11. package/ios/UIComponents/RNPassportScanner.swift +4 -3
  12. package/ios/View/AssentifySdkEventEmitting.swift +10 -0
  13. package/ios/View/DataDecoder.swift +16 -16
  14. package/ios/View/FaceMatchController.swift +51 -51
  15. package/ios/View/IDCardController.swift +37 -37
  16. package/ios/View/OtherController.swift +33 -33
  17. package/ios/View/PassportController.swift +36 -36
  18. package/ios/View/QrController.swift +10 -10
  19. package/ios/View/UI.swift +77 -26
  20. package/lib/commonjs/AssentifyProvider.js +3 -0
  21. package/lib/commonjs/AssentifyProvider.js.map +1 -1
  22. package/lib/commonjs/AssentifyWrapper.js +4 -4
  23. package/lib/commonjs/AssentifyWrapper.js.map +1 -1
  24. package/lib/commonjs/ClickFontWeightType.js +14 -0
  25. package/lib/commonjs/ClickFontWeightType.js.map +1 -0
  26. package/lib/commonjs/FlowStepperType.js +11 -0
  27. package/lib/commonjs/FlowStepperType.js.map +1 -0
  28. package/lib/commonjs/Language.js +5 -1
  29. package/lib/commonjs/Language.js.map +1 -1
  30. package/lib/commonjs/ValidationStyleType.js +11 -0
  31. package/lib/commonjs/ValidationStyleType.js.map +1 -0
  32. package/lib/commonjs/index.js +36 -0
  33. package/lib/commonjs/index.js.map +1 -1
  34. package/lib/commonjs/types.js.map +1 -1
  35. package/lib/module/AssentifyProvider.js +4 -0
  36. package/lib/module/AssentifyProvider.js.map +1 -1
  37. package/lib/module/AssentifyWrapper.js +4 -4
  38. package/lib/module/AssentifyWrapper.js.map +1 -1
  39. package/lib/module/ClickFontWeightType.js +8 -0
  40. package/lib/module/ClickFontWeightType.js.map +1 -0
  41. package/lib/module/FlowStepperType.js +5 -0
  42. package/lib/module/FlowStepperType.js.map +1 -0
  43. package/lib/module/Language.js +4 -0
  44. package/lib/module/Language.js.map +1 -1
  45. package/lib/module/ValidationStyleType.js +5 -0
  46. package/lib/module/ValidationStyleType.js.map +1 -0
  47. package/lib/module/index.js +3 -0
  48. package/lib/module/index.js.map +1 -1
  49. package/lib/module/types.js.map +1 -1
  50. package/lib/typescript/babel.config.d.ts +0 -1
  51. package/lib/typescript/example/babel.config.d.ts +7 -4
  52. package/lib/typescript/example/babel.config.d.ts.map +1 -1
  53. package/lib/typescript/example/metro.config.d.ts +9 -1
  54. package/lib/typescript/example/metro.config.d.ts.map +1 -1
  55. package/lib/typescript/example/react-native.config.d.ts +5 -2
  56. package/lib/typescript/example/react-native.config.d.ts.map +1 -1
  57. package/lib/typescript/example/src/App.d.ts.map +1 -1
  58. package/lib/typescript/example/src/Home.d.ts.map +1 -1
  59. package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +2 -2
  61. package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -1
  62. package/lib/typescript/lib/commonjs/ClickFontWeightType.d.ts +9 -0
  63. package/lib/typescript/lib/commonjs/ClickFontWeightType.d.ts.map +1 -0
  64. package/lib/typescript/lib/commonjs/FlowStepperType.d.ts +6 -0
  65. package/lib/typescript/lib/commonjs/FlowStepperType.d.ts.map +1 -0
  66. package/lib/typescript/lib/commonjs/Language.d.ts +6 -0
  67. package/lib/typescript/lib/commonjs/ValidationStyleType.d.ts +6 -0
  68. package/lib/typescript/lib/commonjs/ValidationStyleType.d.ts.map +1 -0
  69. package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -1
  70. package/lib/typescript/lib/module/AssentifyWrapper.d.ts +2 -2
  71. package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -1
  72. package/lib/typescript/lib/module/ClickFontWeightType.d.ts +8 -0
  73. package/lib/typescript/lib/module/ClickFontWeightType.d.ts.map +1 -0
  74. package/lib/typescript/lib/module/FlowStepperType.d.ts +5 -0
  75. package/lib/typescript/lib/module/FlowStepperType.d.ts.map +1 -0
  76. package/lib/typescript/lib/module/Language.d.ts +6 -0
  77. package/lib/typescript/lib/module/ValidationStyleType.d.ts +5 -0
  78. package/lib/typescript/lib/module/ValidationStyleType.d.ts.map +1 -0
  79. package/lib/typescript/lib/module/index.d.ts +5 -2
  80. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  81. package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
  82. package/lib/typescript/src/AssentifyWrapper.d.ts +6 -2
  83. package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -1
  84. package/lib/typescript/src/ClickFontWeightType.d.ts +9 -0
  85. package/lib/typescript/src/ClickFontWeightType.d.ts.map +1 -0
  86. package/lib/typescript/src/FlowStepperType.d.ts +6 -0
  87. package/lib/typescript/src/FlowStepperType.d.ts.map +1 -0
  88. package/lib/typescript/src/Language.d.ts +5 -0
  89. package/lib/typescript/src/Language.d.ts.map +1 -1
  90. package/lib/typescript/src/ValidationStyleType.d.ts +6 -0
  91. package/lib/typescript/src/ValidationStyleType.d.ts.map +1 -0
  92. package/lib/typescript/src/index.d.ts +5 -2
  93. package/lib/typescript/src/index.d.ts.map +1 -1
  94. package/lib/typescript/src/types.d.ts.map +1 -1
  95. package/package.json +9 -8
  96. package/src/AssentifyProvider.tsx +341 -305
  97. package/src/AssentifyWrapper.ts +47 -6
  98. package/src/ClickFontWeightType.ts +10 -0
  99. package/src/FlowStepperType.ts +7 -0
  100. package/src/Language.ts +7 -0
  101. package/src/ValidationStyleType.ts +7 -0
  102. package/src/index.ts +3 -0
  103. package/src/types.ts +1 -0
  104. package/assentify-sdk.podspec +0 -44
  105. package/lib/typescript/example/src/navigator.d.ts +0 -4
  106. package/lib/typescript/example/src/navigator.d.ts.map +0 -1
@@ -4,11 +4,11 @@ import UIKit
4
4
  import AVFoundation
5
5
  import AssentifySdk
6
6
 
7
- class OtherController: UIViewController ,ScanOtherDelegate , ChildViewControllerDelegate
7
+ public class OtherController: UIViewController ,ScanOtherDelegate , ChildViewControllerDelegate
8
8
  {
9
9
 
10
10
 
11
- func onUploadingProgress(progress: Double) {
11
+ public func onUploadingProgress(progress: Double) {
12
12
  // NOTHING TODO
13
13
  }
14
14
 
@@ -24,13 +24,13 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
24
24
  private var processingColor: String;
25
25
  private var language: String;
26
26
  private var apiKey: String;
27
- private var nativeAssentifySdk:NativeAssentifySdk?;
27
+ private var nativeAssentifySdk:(any AssentifySdkEventEmitting)?;
28
28
  private var scanOther:ScanOther?;
29
29
  private var stepID:Int;
30
30
  private var manualClickColor: String;
31
31
  private var takePhotoButton: UIButton?;
32
32
 
33
- init(assentifySdk: AssentifySdk,nativeAssentifySdk:NativeAssentifySdk,holdHandColor: String,processingColor: String, language: String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
33
+ public init(assentifySdk: AssentifySdk,nativeAssentifySdk:any AssentifySdkEventEmitting,holdHandColor: String,processingColor: String, language: String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
34
34
  self.assentifySdk = assentifySdk
35
35
  self.nativeAssentifySdk = nativeAssentifySdk
36
36
  self.holdHandColor = holdHandColor
@@ -44,14 +44,14 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
44
44
  }
45
45
 
46
46
 
47
- required init?(coder: NSCoder) {
47
+ public required init?(coder: NSCoder) {
48
48
  fatalError("init(coder:) has not been implemented")
49
49
  }
50
50
 
51
- override var prefersStatusBarHidden: Bool {
51
+ public override var prefersStatusBarHidden: Bool {
52
52
  return false
53
53
  }
54
- override func viewDidLoad() {
54
+ public override func viewDidLoad() {
55
55
  super.viewDidLoad()
56
56
  self.view.backgroundColor = .clear
57
57
  UIApplication.shared.isStatusBarHidden = false;
@@ -131,7 +131,7 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
131
131
 
132
132
  }
133
133
 
134
- func onSend() {
134
+ public func onSend() {
135
135
  triggerEvent(eventName:"onSend",dataModel:nil)
136
136
  DispatchQueue.main.async {
137
137
  if(self.popUpMessage != nil){
@@ -142,7 +142,7 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
142
142
  }
143
143
  }
144
144
 
145
- func onError(dataModel: RemoteProcessingModel) {
145
+ public func onError(dataModel: RemoteProcessingModel) {
146
146
  triggerEvent(eventName:"onError",dataModel:dataModel)
147
147
  DispatchQueue.main.async {
148
148
  self.start = false;
@@ -152,7 +152,7 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
152
152
  }
153
153
 
154
154
 
155
- func onRetry(dataModel: RemoteProcessingModel) {
155
+ public func onRetry(dataModel: RemoteProcessingModel) {
156
156
  triggerEvent(eventName:"onRetry",dataModel:dataModel)
157
157
  DispatchQueue.main.async {
158
158
  self.start = false;
@@ -163,7 +163,7 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
163
163
  }
164
164
  }
165
165
 
166
- func onLivenessUpdate(dataModel: RemoteProcessingModel) {
166
+ public func onLivenessUpdate(dataModel: RemoteProcessingModel) {
167
167
  triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
168
168
  DispatchQueue.main.async {
169
169
  self.start = false;
@@ -173,20 +173,20 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
173
173
  }
174
174
 
175
175
 
176
- func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
176
+ public func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
177
177
  triggerEvent(eventName:"onClipPreparationComplete",dataModel:dataModel)
178
178
  }
179
179
 
180
- func onStatusUpdated(dataModel: RemoteProcessingModel) {
180
+ public func onStatusUpdated(dataModel: RemoteProcessingModel) {
181
181
  triggerEvent(eventName:"onStatusUpdated",dataModel:dataModel)
182
182
  }
183
183
 
184
- func onUpdated(dataModel: RemoteProcessingModel) {
184
+ public func onUpdated(dataModel: RemoteProcessingModel) {
185
185
  triggerEvent(eventName:"onUpdated",dataModel:dataModel)
186
186
  }
187
187
 
188
188
 
189
- func onComplete(dataModel: OtherResponseModel) {
189
+ public func onComplete(dataModel: OtherResponseModel) {
190
190
  if(!isDone){
191
191
  isDone = true;
192
192
  if let outputProperties = try? JSONSerialization.data(withJSONObject: dataModel.otherExtractedModel?.transformedProperties, options: []) {
@@ -211,48 +211,48 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
211
211
 
212
212
  }
213
213
 
214
- func onCardDetected(dataModel: RemoteProcessingModel) {
214
+ public func onCardDetected(dataModel: RemoteProcessingModel) {
215
215
  triggerEvent(eventName:"onCardDetected",dataModel:dataModel)
216
216
  }
217
217
 
218
- func onMrzExtracted(dataModel: RemoteProcessingModel) {
218
+ public func onMrzExtracted(dataModel: RemoteProcessingModel) {
219
219
  triggerEvent(eventName:"onMrzExtracted",dataModel:dataModel)
220
220
  }
221
221
 
222
- func onMrzDetected(dataModel: RemoteProcessingModel) {
222
+ public func onMrzDetected(dataModel: RemoteProcessingModel) {
223
223
  triggerEvent(eventName:"onMrzDetected",dataModel:dataModel)
224
224
  }
225
225
 
226
- func onNoMrzDetected(dataModel: RemoteProcessingModel) {
226
+ public func onNoMrzDetected(dataModel: RemoteProcessingModel) {
227
227
  triggerEvent(eventName:"onNoMrzDetected",dataModel:dataModel)
228
228
  }
229
229
 
230
230
 
231
- func onFaceDetected(dataModel: RemoteProcessingModel) {
231
+ public func onFaceDetected(dataModel: RemoteProcessingModel) {
232
232
  triggerEvent(eventName:"onFaceDetected",dataModel:dataModel)
233
233
  }
234
234
 
235
- func onNoFaceDetected(dataModel: RemoteProcessingModel) {
235
+ public func onNoFaceDetected(dataModel: RemoteProcessingModel) {
236
236
  triggerEvent(eventName:"onNoFaceDetected",dataModel:dataModel)
237
237
  }
238
238
 
239
- func onFaceExtracted(dataModel: RemoteProcessingModel) {
239
+ public func onFaceExtracted(dataModel: RemoteProcessingModel) {
240
240
  triggerEvent(eventName:"onFaceExtracted",dataModel:dataModel)
241
241
  }
242
242
 
243
- func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
243
+ public func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
244
244
  triggerEvent(eventName:"onQualityCheckAvailable",dataModel:dataModel)
245
245
  }
246
246
 
247
- func onDocumentCaptured(dataModel: RemoteProcessingModel) {
247
+ public func onDocumentCaptured(dataModel: RemoteProcessingModel) {
248
248
  triggerEvent(eventName:"onDocumentCaptured",dataModel:dataModel)
249
249
  }
250
250
 
251
- func onDocumentCropped(dataModel: RemoteProcessingModel) {
251
+ public func onDocumentCropped(dataModel: RemoteProcessingModel) {
252
252
  triggerEvent(eventName:"onDocumentCropped",dataModel:dataModel)
253
253
  }
254
254
 
255
- func onUploadFailed(dataModel: RemoteProcessingModel) {
255
+ public func onUploadFailed(dataModel: RemoteProcessingModel) {
256
256
  triggerEvent(eventName:"onUploadFailed",dataModel:dataModel)
257
257
  }
258
258
 
@@ -263,38 +263,38 @@ class OtherController: UIViewController ,ScanOtherDelegate , ChildViewController
263
263
  if (zoom == ZoomType.ZOOM_IN) {
264
264
  self.start = false
265
265
  self.infoLabel?.text = "Move ID Closer"
266
- self.infoImage!.image = UIImage(named: "zoom_in")
266
+ self.infoImage!.image = UIImage(named: "zoom_in", in: Bundle.module, compatibleWith: nil)
267
267
  }
268
268
  if (zoom == ZoomType.ZOOM_OUT) {
269
269
  self.start = false
270
270
  self.infoLabel?.text = "Move ID Further"
271
- self.infoImage!.image = UIImage(named: "zoom_out")
271
+ self.infoImage!.image = UIImage(named: "zoom_out", in: Bundle.module, compatibleWith: nil)
272
272
  }
273
273
  } else if (motion != MotionType.SENDING && motion != MotionType.NO_DETECT) {
274
274
  self.start = false
275
275
  self.infoLabel?.text = "Please Hold Your Hand"
276
- self.infoImage!.image = UIImage(named: "info_icon")
276
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
277
277
  } else if brightnessEvents != BrightnessEvents.Good {
278
278
  if brightnessEvents == BrightnessEvents.TooDark {
279
279
  self.start = false
280
280
  self.infoLabel?.text = "Please increase the lighting"
281
- self.infoImage!.image = UIImage(named: "info_icon")
281
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
282
282
  }
283
283
  if brightnessEvents == BrightnessEvents.TooBright {
284
284
  self.start = false
285
285
  self.infoLabel?.text = "Please reduce the lighting"
286
- self.infoImage!.image = UIImage(named: "info_icon")
286
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
287
287
  }
288
288
  } else {
289
289
  if (motion == MotionType.SENDING && zoom == ZoomType.SENDING && brightnessEvents == BrightnessEvents.Good) {
290
290
  self.start = false
291
291
  self.infoLabel?.text = "Hold Steady"
292
- self.infoImage!.image = UIImage(named: "info_icon")
292
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
293
293
  }
294
294
  if (motion == MotionType.NO_DETECT && zoom == ZoomType.NO_DETECT) {
295
295
  self.start = false
296
296
  self.infoLabel?.text = "Please present ID"
297
- self.infoImage!.image = UIImage(named: "info_icon")
297
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
298
298
  }
299
299
  }
300
300
  } else {
@@ -4,17 +4,17 @@ import UIKit
4
4
  import AVFoundation
5
5
  import AssentifySdk
6
6
 
7
- class PassportController: UIViewController ,ScanPassportDelegate , ChildViewControllerDelegate
7
+ public class PassportController: UIViewController ,ScanPassportDelegate , ChildViewControllerDelegate
8
8
  {
9
9
 
10
10
 
11
- func onUploadingProgress(progress: Double) {
11
+ public func onUploadingProgress(progress: Double) {
12
12
  // NOTHING TODO
13
13
  }
14
14
 
15
15
 
16
16
  private var isDone:Bool = false;
17
- private var nativeAssentifySdk:NativeAssentifySdk?;
17
+ private var nativeAssentifySdk:(any AssentifySdkEventEmitting)?;
18
18
  private var assentifySdk:AssentifySdk?;
19
19
  private var start:Bool = false;
20
20
  var infoLabel : UILabel?;
@@ -32,7 +32,7 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
32
32
 
33
33
 
34
34
 
35
- init(assentifySdk: AssentifySdk,nativeAssentifySdk:NativeAssentifySdk?,holdHandColor: String,processingColor: String,language:String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
35
+ public init(assentifySdk: AssentifySdk,nativeAssentifySdk:(any AssentifySdkEventEmitting)?,holdHandColor: String,processingColor: String,language:String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
36
36
  self.assentifySdk = assentifySdk
37
37
  self.nativeAssentifySdk = nativeAssentifySdk
38
38
  self.holdHandColor = holdHandColor
@@ -45,16 +45,16 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
45
45
  super.init(nibName: nil, bundle: nil)
46
46
  }
47
47
 
48
- required init?(coder: NSCoder) {
48
+ public required init?(coder: NSCoder) {
49
49
  fatalError("init(coder:) has not been implemented")
50
50
  }
51
51
 
52
- override var prefersStatusBarHidden: Bool {
52
+ public override var prefersStatusBarHidden: Bool {
53
53
  return false
54
54
  }
55
55
 
56
56
 
57
- override func viewDidLoad() {
57
+ public override func viewDidLoad() {
58
58
  super.viewDidLoad()
59
59
  self.view.backgroundColor = .clear
60
60
  UIApplication.shared.isStatusBarHidden = false;
@@ -138,7 +138,7 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
138
138
  }
139
139
 
140
140
  }
141
- func onSend() {
141
+ public func onSend() {
142
142
  triggerEvent(eventName:"onSend",dataModel:nil)
143
143
  DispatchQueue.main.async {
144
144
  if(self.popUpMessage != nil){
@@ -149,7 +149,7 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
149
149
  }
150
150
  }
151
151
 
152
- func onError(dataModel: RemoteProcessingModel) {
152
+ public func onError(dataModel: RemoteProcessingModel) {
153
153
  triggerEvent(eventName:"onError",dataModel:dataModel)
154
154
  DispatchQueue.main.async {
155
155
  self.start = false;
@@ -159,7 +159,7 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
159
159
  }
160
160
 
161
161
 
162
- func onRetry(dataModel: RemoteProcessingModel) {
162
+ public func onRetry(dataModel: RemoteProcessingModel) {
163
163
  triggerEvent(eventName:"onRetry",dataModel:dataModel)
164
164
  DispatchQueue.main.async {
165
165
  self.start = false;
@@ -171,7 +171,7 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
171
171
  }
172
172
  }
173
173
 
174
- func onLivenessUpdate(dataModel: RemoteProcessingModel) {
174
+ public func onLivenessUpdate(dataModel: RemoteProcessingModel) {
175
175
  triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
176
176
  DispatchQueue.main.async {
177
177
  self.start = false;
@@ -180,7 +180,7 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
180
180
  }
181
181
  }
182
182
 
183
- func onWrongTemplate(dataModel:RemoteProcessingModel) {
183
+ public func onWrongTemplate(dataModel:RemoteProcessingModel) {
184
184
  triggerEvent(eventName:"onWrongTemplate",dataModel:dataModel)
185
185
  DispatchQueue.main.async {
186
186
  self.start = false;
@@ -189,21 +189,21 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
189
189
  }
190
190
  }
191
191
 
192
- func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
192
+ public func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
193
193
  triggerEvent(eventName:"onClipPreparationComplete",dataModel:dataModel)
194
194
  }
195
195
 
196
- func onStatusUpdated(dataModel: RemoteProcessingModel) {
196
+ public func onStatusUpdated(dataModel: RemoteProcessingModel) {
197
197
  triggerEvent(eventName:"onStatusUpdated",dataModel:dataModel)
198
198
  }
199
199
 
200
- func onUpdated(dataModel: RemoteProcessingModel) {
200
+ public func onUpdated(dataModel: RemoteProcessingModel) {
201
201
  triggerEvent(eventName:"onUpdated",dataModel:dataModel)
202
202
  }
203
203
 
204
204
 
205
205
 
206
- func onComplete(dataModel: PassportResponseModel) {
206
+ public func onComplete(dataModel: PassportResponseModel) {
207
207
 
208
208
  if(!isDone){
209
209
  isDone = true;
@@ -227,52 +227,52 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
227
227
 
228
228
  }
229
229
 
230
- func onCardDetected(dataModel: RemoteProcessingModel) {
230
+ public func onCardDetected(dataModel: RemoteProcessingModel) {
231
231
  triggerEvent(eventName:"onCardDetected",dataModel:dataModel)
232
232
  }
233
233
 
234
- func onMrzExtracted(dataModel: RemoteProcessingModel) {
234
+ public func onMrzExtracted(dataModel: RemoteProcessingModel) {
235
235
  triggerEvent(eventName:"onMrzExtracted",dataModel:dataModel)
236
236
  }
237
237
 
238
- func onMrzDetected(dataModel: RemoteProcessingModel) {
238
+ public func onMrzDetected(dataModel: RemoteProcessingModel) {
239
239
  triggerEvent(eventName:"onMrzDetected",dataModel:dataModel)
240
240
  }
241
241
 
242
- func onNoMrzDetected(dataModel: RemoteProcessingModel) {
242
+ public func onNoMrzDetected(dataModel: RemoteProcessingModel) {
243
243
  triggerEvent(eventName:"onNoMrzDetected",dataModel:dataModel)
244
244
  }
245
245
 
246
246
 
247
- func onFaceDetected(dataModel: RemoteProcessingModel) {
247
+ public func onFaceDetected(dataModel: RemoteProcessingModel) {
248
248
  triggerEvent(eventName:"onFaceDetected",dataModel:dataModel)
249
249
  }
250
250
 
251
- func onNoFaceDetected(dataModel: RemoteProcessingModel) {
251
+ public func onNoFaceDetected(dataModel: RemoteProcessingModel) {
252
252
  triggerEvent(eventName:"onNoFaceDetected",dataModel:dataModel)
253
253
  }
254
254
 
255
- func onFaceExtracted(dataModel: RemoteProcessingModel) {
255
+ public func onFaceExtracted(dataModel: RemoteProcessingModel) {
256
256
  triggerEvent(eventName:"onFaceExtracted",dataModel:dataModel)
257
257
  }
258
258
 
259
- func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
259
+ public func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
260
260
  triggerEvent(eventName:"onQualityCheckAvailable",dataModel:dataModel)
261
261
  }
262
262
 
263
- func onDocumentCaptured(dataModel: RemoteProcessingModel) {
263
+ public func onDocumentCaptured(dataModel: RemoteProcessingModel) {
264
264
  triggerEvent(eventName:"onDocumentCaptured",dataModel:dataModel)
265
265
  }
266
266
 
267
- func onDocumentCropped(dataModel: RemoteProcessingModel) {
267
+ public func onDocumentCropped(dataModel: RemoteProcessingModel) {
268
268
  triggerEvent(eventName:"onDocumentCropped",dataModel:dataModel)
269
269
  }
270
270
 
271
- func onUploadFailed(dataModel: RemoteProcessingModel) {
271
+ public func onUploadFailed(dataModel: RemoteProcessingModel) {
272
272
  triggerEvent(eventName:"onUploadFailed",dataModel:dataModel)
273
273
  }
274
274
 
275
- func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
275
+ public func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
276
276
  motion: MotionType,
277
277
  zoom: ZoomType,
278
278
  isCentered:Bool) {
@@ -282,42 +282,42 @@ class PassportController: UIViewController ,ScanPassportDelegate , ChildViewCont
282
282
  if (zoom == ZoomType.ZOOM_IN) {
283
283
  self.start = false
284
284
  self.infoLabel?.text = "Move Passport Closer"
285
- self.infoImage!.image = UIImage(named: "zoom_in")
285
+ self.infoImage!.image = UIImage(named: "zoom_in", in: Bundle.module, compatibleWith: nil)
286
286
  }
287
287
  if (zoom == ZoomType.ZOOM_OUT) {
288
288
  self.start = false
289
289
  self.infoLabel?.text = "Move Passport Further"
290
- self.infoImage!.image = UIImage(named: "zoom_out")
290
+ self.infoImage!.image = UIImage(named: "zoom_out", in: Bundle.module, compatibleWith: nil)
291
291
  }
292
292
  } else if (motion != MotionType.SENDING && motion != MotionType.NO_DETECT) {
293
293
  self.start = false
294
294
  self.infoLabel?.text = "Please Hold Your Hand"
295
- self.infoImage!.image = UIImage(named: "info_icon")
295
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
296
296
  } else if brightnessEvents != BrightnessEvents.Good {
297
297
  if brightnessEvents == BrightnessEvents.TooDark {
298
298
  self.start = false
299
299
  self.infoLabel?.text = "Please increase the lighting"
300
- self.infoImage!.image = UIImage(named: "info_icon")
300
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
301
301
  }
302
302
  if brightnessEvents == BrightnessEvents.TooBright {
303
303
  self.start = false
304
304
  self.infoLabel?.text = "Please reduce the lighting"
305
- self.infoImage!.image = UIImage(named: "info_icon")
305
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
306
306
  }
307
307
  } else {
308
308
  if (motion == MotionType.SENDING && zoom == ZoomType.SENDING && brightnessEvents == BrightnessEvents.Good) {
309
309
  self.start = false
310
310
  self.infoLabel?.text = "Hold Steady"
311
- self.infoImage!.image = UIImage(named: "info_icon")
311
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
312
312
  }
313
313
  if (motion == MotionType.NO_DETECT && zoom == ZoomType.NO_DETECT) {
314
314
  self.start = false
315
315
  self.infoLabel?.text = "Please present passport"
316
- self.infoImage!.image = UIImage(named: "info_icon")
316
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
317
317
  } else if(!isCentered){
318
318
  self.start = false
319
319
  self.infoLabel?.text = " Please center your card"
320
- self.infoImage!.image = UIImage(named: "info_icon")
320
+ self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
321
321
  }
322
322
 
323
323
  }
@@ -3,12 +3,12 @@ import UIKit
3
3
  import AVFoundation
4
4
  import AssentifySdk
5
5
 
6
- class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelegate
6
+ public class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelegate
7
7
  {
8
8
 
9
9
 
10
10
 
11
- func onUploadingProgress(progress: Double) {
11
+ public func onUploadingProgress(progress: Double) {
12
12
  // NOTHING TODO
13
13
  }
14
14
 
@@ -27,7 +27,7 @@ class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelega
27
27
  private var showCountDown:Bool = true;
28
28
  private var templatesByCountry: TemplatesByCountry;
29
29
  private var titleID:String? = "";
30
- private var nativeAssentifySdk:NativeAssentifySdk?;
30
+ private var nativeAssentifySdk:(any AssentifySdkEventEmitting)?;
31
31
  private var outputResultProperties: [String: Any]? = [:];
32
32
  private var stepID:Int;
33
33
  private var manualClickColor: String;
@@ -35,7 +35,7 @@ class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelega
35
35
  private var backIDPage: UIView?;
36
36
  private var scanQr:ScanQr?;
37
37
 
38
- init(assentifySdk: AssentifySdk,nativeAssentifySdk:NativeAssentifySdk,holdHandColor: String,processingColor: String,templatesByCountry: TemplatesByCountry,language:String,titleID:String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
38
+ public init(assentifySdk: AssentifySdk,nativeAssentifySdk:any AssentifySdkEventEmitting,holdHandColor: String,processingColor: String,templatesByCountry: TemplatesByCountry,language:String,titleID:String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
39
39
  self.assentifySdk = assentifySdk
40
40
  self.nativeAssentifySdk = nativeAssentifySdk
41
41
  self.holdHandColor = holdHandColor
@@ -50,14 +50,14 @@ class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelega
50
50
  super.init(nibName: nil, bundle: nil)
51
51
  }
52
52
 
53
- required init?(coder: NSCoder) {
53
+ public required init?(coder: NSCoder) {
54
54
  fatalError("init(coder:) has not been implemented")
55
55
  }
56
56
 
57
- override var prefersStatusBarHidden: Bool {
57
+ public override var prefersStatusBarHidden: Bool {
58
58
  return false
59
59
  }
60
- override func viewDidLoad() {
60
+ public override func viewDidLoad() {
61
61
  super.viewDidLoad()
62
62
  self.view.backgroundColor = .clear
63
63
  UIApplication.shared.isStatusBarHidden = false;
@@ -135,7 +135,7 @@ class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelega
135
135
 
136
136
  }
137
137
 
138
- func onStartQrScan() {
138
+ public func onStartQrScan() {
139
139
  triggerEvent(eventName:"onStartQrScan",dataModel:nil)
140
140
  DispatchQueue.main.async {
141
141
  if(self.popUpMessage != nil){
@@ -146,7 +146,7 @@ class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelega
146
146
  }
147
147
  }
148
148
 
149
- func onErrorQrScan(message: String,dataModel: RemoteProcessingModel) {
149
+ public func onErrorQrScan(message: String,dataModel: RemoteProcessingModel) {
150
150
  triggerEvent(eventName:"onErrorQrScan",dataModel:nil)
151
151
  DispatchQueue.main.async {
152
152
  self.start = false;
@@ -155,7 +155,7 @@ class QrController: UIViewController ,ScanQrDelegate , ChildViewControllerDelega
155
155
  }
156
156
  }
157
157
 
158
- func onCompleteQrScan(dataModel: IDResponseModel) {
158
+ public func onCompleteQrScan(dataModel: IDResponseModel) {
159
159
  if let outputProperties = try? JSONSerialization.data(withJSONObject: dataModel.iDExtractedModel?.transformedProperties, options: []) {
160
160
  if UserDefaults.standard.object(forKey: String(self.stepID)) != nil {
161
161
  UserDefaults.standard.removeObject(forKey: String(self.stepID))
package/ios/View/UI.swift CHANGED
@@ -1,43 +1,94 @@
1
1
 
2
2
 
3
+ import UIKit
4
+
3
5
  protocol ChildViewControllerDelegate: AnyObject {
4
6
  func dismissParentViewController()
5
7
  }
6
8
 
7
9
 
8
- func showNavigationBarWithBackArrow(view: UIView, target: Any?, action: Selector?, initialTextColorHex: String, initialBackgroundColorHex: String, title: String ){
9
- let navigationBar = UINavigationBar(frame: CGRect(x: 0, y: 55, width: view.frame.size.width, height: 50))
10
+ func showNavigationBarWithBackArrow(
11
+ view: UIView,
12
+ target: Any?,
13
+ action: Selector?,
14
+ initialTextColorHex: String,
15
+ initialBackgroundColorHex: String,
16
+ title: String
17
+ ) {
18
+ let navigationBar = UINavigationBar(
19
+ frame: CGRect(
20
+ x: 0,
21
+ y: 55,
22
+ width: view.frame.size.width,
23
+ height: 50
24
+ )
25
+ )
26
+
10
27
  navigationBar.setBackgroundImage(UIImage(), for: .default)
11
28
  navigationBar.shadowImage = UIImage()
12
29
  navigationBar.isTranslucent = true
13
30
  navigationBar.backgroundColor = .clear
14
-
31
+
15
32
  let navigationItem = UINavigationItem()
33
+
34
+ // MARK: - Back Button
35
+
16
36
  let backButton = UIButton(type: .custom)
17
- backButton.setImage(UIImage(systemName: "chevron.left"), for: .normal)
18
- backButton.tintColor = UIColor(hexString: initialTextColorHex)
37
+
38
+ backButton.frame = CGRect(
39
+ x: 0,
40
+ y: 0,
41
+ width: 40,
42
+ height: 40
43
+ )
44
+
45
+ // No background
46
+ backButton.backgroundColor = .clear
47
+
48
+ let symbolConfig = UIImage.SymbolConfiguration(
49
+ pointSize: 22,
50
+ weight: .medium
51
+ )
52
+
53
+ let backImage = UIImage(
54
+ systemName: "chevron.left",
55
+ withConfiguration: symbolConfig
56
+ )?.withRenderingMode(.alwaysTemplate)
57
+
58
+ backButton.setImage(backImage, for: .normal)
59
+
60
+ backButton.tintColor =
61
+ UIColor(hexString: initialTextColorHex) ?? .white
62
+
19
63
  backButton.contentHorizontalAlignment = .center
20
- backButton.addTarget(target, action: action!, for: .touchUpInside)
21
-
22
- let buttonSize: CGFloat = 40
23
- backButton.frame = CGRect(x: 0, y: 0, width: buttonSize, height: buttonSize)
24
-
25
- backButton.backgroundColor = UIColor(hexString: initialBackgroundColorHex)
26
- backButton.layer.cornerRadius = buttonSize / 2
27
- backButton.layer.masksToBounds = true
28
-
29
- let backButtonItem = UIBarButtonItem(customView: backButton)
30
- navigationItem.leftBarButtonItem = backButtonItem
31
-
64
+ backButton.contentVerticalAlignment = .center
65
+
66
+ if let action = action {
67
+ backButton.addTarget(
68
+ target,
69
+ action: action,
70
+ for: .touchUpInside
71
+ )
72
+ }
73
+
74
+ navigationItem.leftBarButtonItem = UIBarButtonItem(
75
+ customView: backButton
76
+ )
77
+
78
+ // MARK: - Title
79
+
32
80
  navigationItem.title = title
33
- let titleAttributes: [NSAttributedString.Key: Any] = [
34
- .foregroundColor: UIColor(hexString: initialTextColorHex),
35
- .font: UIFont.systemFont(ofSize: 22)
36
81
 
82
+ navigationBar.titleTextAttributes = [
83
+ .foregroundColor:
84
+ UIColor(hexString: initialTextColorHex) ?? .white,
85
+
86
+ .font:
87
+ UIFont.systemFont(ofSize: 22)
37
88
  ]
38
- navigationBar.titleTextAttributes = titleAttributes
39
-
89
+
40
90
  navigationBar.items = [navigationItem]
91
+
41
92
  view.addSubview(navigationBar)
42
93
  }
43
94
 
@@ -60,7 +111,7 @@ func showInfo(view: UIView, text: String, initialTextColorHex: String, initialBa
60
111
  label.translatesAutoresizingMaskIntoConstraints = false
61
112
 
62
113
  let imageView = UIImageView()
63
- imageView.image = UIImage(named: initialImageName)
114
+ imageView.image = UIImage(named: initialImageName, in: Bundle.module, compatibleWith: nil)
64
115
  imageView.contentMode = .scaleAspectFit
65
116
  imageView.translatesAutoresizingMaskIntoConstraints = false
66
117
 
@@ -111,7 +162,7 @@ func showPopUpMessage(view: UIView, title: String, subTitle: String, initialText
111
162
  if isGif, let gifImage = UIImage.gifImageWithName(iconName) {
112
163
  imageView.image = gifImage
113
164
  } else {
114
- imageView.image = UIImage(named: iconName)
165
+ imageView.image = UIImage(named: iconName, in: Bundle.module, compatibleWith: nil)
115
166
  }
116
167
  imageView.contentMode = .scaleAspectFit
117
168
  imageView.translatesAutoresizingMaskIntoConstraints = false
@@ -299,7 +350,7 @@ func showBackIDPage(
299
350
  gifImageView.image = animated
300
351
  gifImageView.startAnimating()
301
352
  } else {
302
- gifImageView.image = UIImage(named: "card") // fallback
353
+ gifImageView.image = UIImage(named: "card", in: Bundle.module, compatibleWith: nil) // fallback
303
354
  }
304
355
 
305
356
  // Stack order: Title → URL Image → Subtitle → GIF
@@ -411,7 +462,7 @@ extension UIColor {
411
462
  }
412
463
  extension UIImage {
413
464
  class func gifImageWithName(_ name: String) -> UIImage? {
414
- guard let bundleURL = Bundle.main.url(forResource: name, withExtension: "gif") else {
465
+ guard let bundleURL = Bundle.module.url(forResource: name, withExtension: "gif") else {
415
466
  return nil
416
467
  }
417
468
  guard let imageData = try? Data(contentsOf: bundleURL) else {