assentify-sdk-react-native 1.0.0-Beta.21 → 1.0.0-Beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +172 -0
- package/README.md +11 -32
- package/android/build.gradle +1 -6
- package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +8 -5
- package/android/src/main/java/com/assentifysdk/FlowActivity.kt +5 -5
- package/ios/AssentifySdkBaseModule.swift +1 -0
- package/ios/NativeAssentifySdk.mm +2 -1
- package/ios/NativeAssentifySdk.swift +18 -13
- package/ios/UIComponents/RNPassportScanner.swift +4 -3
- package/ios/View/AssentifySdkEventEmitting.swift +10 -0
- package/ios/View/DataDecoder.swift +16 -16
- package/ios/View/FaceMatchController.swift +51 -51
- package/ios/View/IDCardController.swift +37 -37
- package/ios/View/OtherController.swift +33 -33
- package/ios/View/PassportController.swift +36 -36
- package/ios/View/QrController.swift +10 -10
- package/ios/View/UI.swift +77 -26
- package/lib/commonjs/AssentifyProvider.js +3 -0
- package/lib/commonjs/AssentifyProvider.js.map +1 -1
- package/lib/commonjs/AssentifyWrapper.js +4 -4
- package/lib/commonjs/AssentifyWrapper.js.map +1 -1
- package/lib/commonjs/Language.js +5 -1
- package/lib/commonjs/Language.js.map +1 -1
- package/lib/module/AssentifyProvider.js +4 -0
- package/lib/module/AssentifyProvider.js.map +1 -1
- package/lib/module/AssentifyWrapper.js +4 -4
- package/lib/module/AssentifyWrapper.js.map +1 -1
- package/lib/module/Language.js +4 -0
- package/lib/module/Language.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +0 -1
- package/lib/typescript/example/babel.config.d.ts +7 -4
- package/lib/typescript/example/babel.config.d.ts.map +1 -1
- package/lib/typescript/example/metro.config.d.ts +9 -1
- package/lib/typescript/example/metro.config.d.ts.map +1 -1
- package/lib/typescript/example/react-native.config.d.ts +5 -2
- package/lib/typescript/example/react-native.config.d.ts.map +1 -1
- package/lib/typescript/example/src/App.d.ts.map +1 -1
- package/lib/typescript/example/src/Home.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +2 -2
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Language.d.ts +6 -0
- package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts +2 -2
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/module/Language.d.ts +6 -0
- package/lib/typescript/lib/module/index.d.ts +2 -2
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyWrapper.d.ts +3 -2
- package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/src/Language.d.ts +5 -0
- package/lib/typescript/src/Language.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/package.json +9 -8
- package/src/AssentifyProvider.tsx +341 -305
- package/src/AssentifyWrapper.ts +7 -4
- package/src/Language.ts +7 -0
- package/assentify-sdk.podspec +0 -44
- package/lib/typescript/example/src/navigator.d.ts +0 -4
- package/lib/typescript/example/src/navigator.d.ts.map +0 -1
|
@@ -4,22 +4,22 @@ import UIKit
|
|
|
4
4
|
import AVFoundation
|
|
5
5
|
import AssentifySdk
|
|
6
6
|
|
|
7
|
-
class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
7
|
+
public class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
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
|
-
func onCollectingManualImages(){
|
|
15
|
+
public func onCollectingManualImages(){
|
|
16
16
|
// NOTHING TODO
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
private var assentifySdk:AssentifySdk?;
|
|
21
21
|
private var secondImage:String = "";
|
|
22
|
-
private var nativeAssentifySdk:
|
|
22
|
+
private var nativeAssentifySdk:(any AssentifySdkEventEmitting)?;
|
|
23
23
|
private var start:Bool = false;
|
|
24
24
|
var infoLabel : UILabel?;
|
|
25
25
|
var infoImage : UIImageView?;
|
|
@@ -34,7 +34,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
34
34
|
private var takePhotoButton: UIButton?;
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
init(assentifySdk: AssentifySdk, nativeAssentifySdk:
|
|
37
|
+
public init(assentifySdk: AssentifySdk, nativeAssentifySdk:(any AssentifySdkEventEmitting)?,holdHandColor: String,processingColor: String,secondImage:String,showCountDown:Bool,stepID:Int,manualClickColor:String) {
|
|
38
38
|
self.assentifySdk = assentifySdk
|
|
39
39
|
self.holdHandColor = holdHandColor
|
|
40
40
|
self.processingColor = processingColor
|
|
@@ -48,14 +48,14 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
required init?(coder: NSCoder) {
|
|
51
|
+
public required init?(coder: NSCoder) {
|
|
52
52
|
fatalError("init(coder:) has not been implemented")
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
override var prefersStatusBarHidden: Bool {
|
|
55
|
+
public override var prefersStatusBarHidden: Bool {
|
|
56
56
|
return false
|
|
57
57
|
}
|
|
58
|
-
override func viewDidLoad() {
|
|
58
|
+
public override func viewDidLoad() {
|
|
59
59
|
super.viewDidLoad()
|
|
60
60
|
self.view.backgroundColor = .clear
|
|
61
61
|
UIApplication.shared.isStatusBarHidden = false;
|
|
@@ -134,7 +134,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
134
134
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
func onSend() {
|
|
137
|
+
public func onSend() {
|
|
138
138
|
triggerEvent(eventName:"onSend",dataModel:nil)
|
|
139
139
|
DispatchQueue.main.async {
|
|
140
140
|
if(self.popUpMessage != nil){
|
|
@@ -145,7 +145,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
func onError(dataModel: RemoteProcessingModel) {
|
|
148
|
+
public func onError(dataModel: RemoteProcessingModel) {
|
|
149
149
|
triggerEvent(eventName:"onError",dataModel:dataModel)
|
|
150
150
|
DispatchQueue.main.async {
|
|
151
151
|
self.start = false;
|
|
@@ -155,7 +155,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
|
|
158
|
-
func onRetry(dataModel: RemoteProcessingModel) {
|
|
158
|
+
public func onRetry(dataModel: RemoteProcessingModel) {
|
|
159
159
|
triggerEvent(eventName:"onRetry",dataModel:dataModel)
|
|
160
160
|
DispatchQueue.main.async {
|
|
161
161
|
self.start = false;
|
|
@@ -166,7 +166,7 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
func onLivenessUpdate(dataModel: RemoteProcessingModel) {
|
|
169
|
+
public func onLivenessUpdate(dataModel: RemoteProcessingModel) {
|
|
170
170
|
triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
|
|
171
171
|
DispatchQueue.main.async {
|
|
172
172
|
self.start = false;
|
|
@@ -176,21 +176,21 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
|
|
179
|
+
public func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
|
|
180
180
|
triggerEvent(eventName:"onClipPreparationComplete",dataModel:dataModel)
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
func onStatusUpdated(dataModel: RemoteProcessingModel) {
|
|
183
|
+
public func onStatusUpdated(dataModel: RemoteProcessingModel) {
|
|
184
184
|
triggerEvent(eventName:"onStatusUpdated",dataModel:dataModel)
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
func onUpdated(dataModel: RemoteProcessingModel) {
|
|
187
|
+
public func onUpdated(dataModel: RemoteProcessingModel) {
|
|
188
188
|
triggerEvent(eventName:"onUpdated",dataModel:dataModel)
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
|
|
192
192
|
|
|
193
|
-
func onComplete(dataModel: FaceResponseModel) {
|
|
193
|
+
public func onComplete(dataModel: FaceResponseModel) {
|
|
194
194
|
|
|
195
195
|
if let outputProperties = try? JSONSerialization.data(withJSONObject: dataModel.faceExtractedModel?.outputProperties, options: []) {
|
|
196
196
|
if UserDefaults.standard.object(forKey: String(self.stepID)) != nil {
|
|
@@ -211,52 +211,52 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
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
|
|
|
259
|
-
func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
|
|
259
|
+
public func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
|
|
260
260
|
motion: MotionType,
|
|
261
261
|
faceEvents: FaceEvents,
|
|
262
262
|
zoom: ZoomType,
|
|
@@ -267,75 +267,75 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
267
267
|
// Fetected Faces Handling
|
|
268
268
|
if (detectedFaces > 1 ) {
|
|
269
269
|
self.infoLabel?.text = "We detected more than one face.\nPlease keep just your face in view."
|
|
270
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
270
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
271
271
|
}
|
|
272
272
|
// Zoom Type Handling
|
|
273
273
|
else if (zoom != ZoomType.SENDING && zoom != ZoomType.NO_DETECT) {
|
|
274
274
|
if (zoom == ZoomType.ZOOM_IN) {
|
|
275
275
|
self.infoLabel?.text = "Please Move Closer"
|
|
276
|
-
self.infoImage!.image = UIImage(named: "zoom_in")
|
|
276
|
+
self.infoImage!.image = UIImage(named: "zoom_in", in: Bundle.module, compatibleWith: nil)
|
|
277
277
|
}
|
|
278
278
|
if (zoom == ZoomType.ZOOM_OUT) {
|
|
279
279
|
self.infoLabel?.text = "Please Move Further"
|
|
280
|
-
self.infoImage!.image = UIImage(named: "zoom_out")
|
|
280
|
+
self.infoImage!.image = UIImage(named: "zoom_out", in: Bundle.module, compatibleWith: nil)
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
// Motion Type Handling
|
|
284
284
|
else if (motion != MotionType.SENDING && motion != MotionType.NO_DETECT) {
|
|
285
285
|
self.infoLabel?.text = "Please Hold Your Hand"
|
|
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
|
// Brightness Events Handling
|
|
289
289
|
else if (brightnessEvents != BrightnessEvents.Good) {
|
|
290
290
|
if (brightnessEvents == BrightnessEvents.TooDark) {
|
|
291
291
|
self.infoLabel?.text = "Please increase the lighting"
|
|
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 (brightnessEvents == BrightnessEvents.TooBright) {
|
|
295
295
|
self.infoLabel?.text = "Please reduce the lighting"
|
|
296
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
296
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
// Face Events Handling
|
|
300
300
|
else if (faceEvents != FaceEvents.GOOD && faceEvents != FaceEvents.NO_DETECT) {
|
|
301
301
|
if (faceEvents == FaceEvents.ROLL_LEFT) {
|
|
302
302
|
self.infoLabel?.text = "Please tilt your head to the right"
|
|
303
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
303
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
304
304
|
}
|
|
305
305
|
if (faceEvents == FaceEvents.ROLL_RIGHT) {
|
|
306
306
|
self.infoLabel?.text = "Please tilt your head to the left"
|
|
307
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
307
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
308
308
|
}
|
|
309
309
|
if (faceEvents == FaceEvents.YAW_LEFT) {
|
|
310
310
|
self.infoLabel?.text = "Please turn your head to the right"
|
|
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 (faceEvents == FaceEvents.YAW_RIGHT) {
|
|
314
314
|
self.infoLabel?.text = "Please turn your head to the left"
|
|
315
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
315
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
316
316
|
}
|
|
317
317
|
if (faceEvents == FaceEvents.PITCH_UP) {
|
|
318
318
|
self.infoLabel?.text = "Please lower your head"
|
|
319
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
319
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
320
320
|
}
|
|
321
321
|
if (faceEvents == FaceEvents.PITCH_DOWN) {
|
|
322
322
|
self.infoLabel?.text = "Please raise your head"
|
|
323
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
323
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
// Final Conditions
|
|
327
327
|
else {
|
|
328
328
|
if (motion == MotionType.SENDING && zoom == ZoomType.SENDING && brightnessEvents == BrightnessEvents.Good && faceEvents == FaceEvents.GOOD) {
|
|
329
329
|
self.infoLabel?.text = "Hold Steady"
|
|
330
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
330
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
331
331
|
}
|
|
332
332
|
if (motion == MotionType.NO_DETECT && zoom == ZoomType.NO_DETECT && faceEvents == FaceEvents.NO_DETECT) {
|
|
333
333
|
self.infoLabel?.text = "Please face within circle"
|
|
334
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
334
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
335
335
|
} else if(!isCentered){
|
|
336
336
|
self.start = false
|
|
337
337
|
self.infoLabel?.text = " Please center your face"
|
|
338
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
338
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
} else {
|
|
@@ -348,33 +348,33 @@ class FaceMAtchController: UIViewController ,FaceMatchDelegate
|
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
func onCurrentLiveMoveChange(activeLiveEvents: ActiveLiveEvents) {
|
|
351
|
+
public func onCurrentLiveMoveChange(activeLiveEvents: ActiveLiveEvents) {
|
|
352
352
|
DispatchQueue.main.async {
|
|
353
353
|
self.currentActiveLiveEvents = activeLiveEvents
|
|
354
354
|
switch activeLiveEvents {
|
|
355
355
|
case .YAW_LEFT:
|
|
356
356
|
self.infoLabel?.text = "Please move your face left"
|
|
357
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
357
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
358
358
|
case .YAW_RIGHT:
|
|
359
359
|
self.infoLabel?.text = "Please move your face right"
|
|
360
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
360
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
361
361
|
case .PITCH_UP:
|
|
362
362
|
self.infoLabel?.text = "Please move your face up"
|
|
363
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
363
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
364
364
|
case .PITCH_DOWN:
|
|
365
365
|
self.infoLabel?.text = "Please move your face down"
|
|
366
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
366
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
367
367
|
case .GOOD:
|
|
368
368
|
break
|
|
369
369
|
case .WINK_LEFT:
|
|
370
370
|
self.infoLabel?.text = "Please wink with your left eye"
|
|
371
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
371
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
372
372
|
case .WINK_RIGHT:
|
|
373
373
|
self.infoLabel?.text = "Please wink with your right eye"
|
|
374
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
374
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
375
375
|
case .BLINK:
|
|
376
376
|
self.infoLabel?.text = "Please blink your eyes"
|
|
377
|
-
self.infoImage?.image = UIImage(named: "info_icon")
|
|
377
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
}
|
|
@@ -4,10 +4,10 @@ import UIKit
|
|
|
4
4
|
import AVFoundation
|
|
5
5
|
import AssentifySdk
|
|
6
6
|
|
|
7
|
-
class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControllerDelegate
|
|
7
|
+
public class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControllerDelegate
|
|
8
8
|
{
|
|
9
9
|
|
|
10
|
-
func onUploadingProgress(progress: Double) {
|
|
10
|
+
public func onUploadingProgress(progress: Double) {
|
|
11
11
|
// NOTHING TODO
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -26,7 +26,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
26
26
|
private var showCountDown:Bool = true;
|
|
27
27
|
private var templatesByCountry: TemplatesByCountry;
|
|
28
28
|
private var titleID:String? = "";
|
|
29
|
-
private var nativeAssentifySdk:
|
|
29
|
+
private var nativeAssentifySdk:(any AssentifySdkEventEmitting)?;
|
|
30
30
|
private var outputResultProperties: [String: Any]? = [:];
|
|
31
31
|
private var scanID:ScanIDCard?;
|
|
32
32
|
private var stepID:Int;
|
|
@@ -34,7 +34,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
34
34
|
private var takePhotoButton: UIButton?;
|
|
35
35
|
private var backIDPage: UIView?;
|
|
36
36
|
|
|
37
|
-
init(assentifySdk: AssentifySdk,nativeAssentifySdk:
|
|
37
|
+
public init(assentifySdk: AssentifySdk,nativeAssentifySdk:any AssentifySdkEventEmitting,holdHandColor: String,processingColor: String,templatesByCountry:TemplatesByCountry,language:String,flippingCard:Bool,titleID:String,showCountDown:Bool,apiKey:String,stepID:Int,manualClickColor:String) {
|
|
38
38
|
self.assentifySdk = assentifySdk
|
|
39
39
|
self.nativeAssentifySdk = nativeAssentifySdk
|
|
40
40
|
self.holdHandColor = holdHandColor
|
|
@@ -49,14 +49,14 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
49
49
|
self.manualClickColor = manualClickColor;
|
|
50
50
|
super.init(nibName: nil, bundle: nil)
|
|
51
51
|
}
|
|
52
|
-
required init?(coder: NSCoder) {
|
|
52
|
+
public required init?(coder: NSCoder) {
|
|
53
53
|
fatalError("init(coder:) has not been implemented")
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
override var prefersStatusBarHidden: Bool {
|
|
56
|
+
public override var prefersStatusBarHidden: Bool {
|
|
57
57
|
return false
|
|
58
58
|
}
|
|
59
|
-
override func viewDidLoad() {
|
|
59
|
+
public override func viewDidLoad() {
|
|
60
60
|
super.viewDidLoad()
|
|
61
61
|
self.view.backgroundColor = .clear
|
|
62
62
|
UIApplication.shared.isStatusBarHidden = false;
|
|
@@ -138,7 +138,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
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 IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
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 IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
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;
|
|
@@ -170,7 +170,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
func onLivenessUpdate(dataModel: RemoteProcessingModel) {
|
|
173
|
+
public func onLivenessUpdate(dataModel: RemoteProcessingModel) {
|
|
174
174
|
triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
|
|
175
175
|
DispatchQueue.main.async {
|
|
176
176
|
self.start = false;
|
|
@@ -179,7 +179,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
func onWrongTemplate(dataModel:RemoteProcessingModel) {
|
|
182
|
+
public func onWrongTemplate(dataModel:RemoteProcessingModel) {
|
|
183
183
|
triggerEvent(eventName:"onWrongTemplate",dataModel:dataModel)
|
|
184
184
|
DispatchQueue.main.async {
|
|
185
185
|
self.start = false;
|
|
@@ -187,21 +187,21 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
187
187
|
self.popUpMessage = showPopUpMessage(view: self.view, title: "Please double-check that you selected the correct ID type and are presenting this ID type.", subTitle: "Let's try again",initialTextColorHex:self.processingColor,initialBackgroundColorHex:self.holdHandColor, iconName: "id_warning", isGif: false,target: self, action: #selector(self.dismissPopUpMessage))
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
|
|
190
|
+
public func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
|
|
191
191
|
triggerEvent(eventName:"onClipPreparationComplete",dataModel:dataModel)
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
func onStatusUpdated(dataModel: RemoteProcessingModel) {
|
|
194
|
+
public func onStatusUpdated(dataModel: RemoteProcessingModel) {
|
|
195
195
|
triggerEvent(eventName:"onStatusUpdated",dataModel:dataModel)
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
func onUpdated(dataModel: RemoteProcessingModel) {
|
|
198
|
+
public func onUpdated(dataModel: RemoteProcessingModel) {
|
|
199
199
|
triggerEvent(eventName:"onUpdated",dataModel:dataModel)
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
|
|
203
203
|
|
|
204
|
-
func onComplete(dataModel: IDResponseModel ,isFrontPage:Bool,isLastPage:Bool,classifiedTemplate: String) {
|
|
204
|
+
public func onComplete(dataModel: IDResponseModel ,isFrontPage:Bool,isLastPage:Bool,classifiedTemplate: String) {
|
|
205
205
|
|
|
206
206
|
self.triggerCompleteEvent(eventName:"onComplete",dataModel:dataModel.iDExtractedModel,isFrontPage:isFrontPage,isLastPage: isLastPage ,classifiedTemplate:classifiedTemplate)
|
|
207
207
|
|
|
@@ -280,52 +280,52 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
280
280
|
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
func onCardDetected(dataModel: RemoteProcessingModel) {
|
|
283
|
+
public func onCardDetected(dataModel: RemoteProcessingModel) {
|
|
284
284
|
triggerEvent(eventName:"onCardDetected",dataModel:dataModel)
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
func onMrzExtracted(dataModel: RemoteProcessingModel) {
|
|
287
|
+
public func onMrzExtracted(dataModel: RemoteProcessingModel) {
|
|
288
288
|
triggerEvent(eventName:"onMrzExtracted",dataModel:dataModel)
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
func onMrzDetected(dataModel: RemoteProcessingModel) {
|
|
291
|
+
public func onMrzDetected(dataModel: RemoteProcessingModel) {
|
|
292
292
|
triggerEvent(eventName:"onMrzDetected",dataModel:dataModel)
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
func onNoMrzDetected(dataModel: RemoteProcessingModel) {
|
|
295
|
+
public func onNoMrzDetected(dataModel: RemoteProcessingModel) {
|
|
296
296
|
triggerEvent(eventName:"onNoMrzDetected",dataModel:dataModel)
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
|
|
300
|
-
func onFaceDetected(dataModel: RemoteProcessingModel) {
|
|
300
|
+
public func onFaceDetected(dataModel: RemoteProcessingModel) {
|
|
301
301
|
triggerEvent(eventName:"onFaceDetected",dataModel:dataModel)
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
func onNoFaceDetected(dataModel: RemoteProcessingModel) {
|
|
304
|
+
public func onNoFaceDetected(dataModel: RemoteProcessingModel) {
|
|
305
305
|
triggerEvent(eventName:"onNoFaceDetected",dataModel:dataModel)
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
func onFaceExtracted(dataModel: RemoteProcessingModel) {
|
|
308
|
+
public func onFaceExtracted(dataModel: RemoteProcessingModel) {
|
|
309
309
|
triggerEvent(eventName:"onFaceExtracted",dataModel:dataModel)
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
|
|
312
|
+
public func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
|
|
313
313
|
triggerEvent(eventName:"onQualityCheckAvailable",dataModel:dataModel)
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
func onDocumentCaptured(dataModel: RemoteProcessingModel) {
|
|
316
|
+
public func onDocumentCaptured(dataModel: RemoteProcessingModel) {
|
|
317
317
|
triggerEvent(eventName:"onDocumentCaptured",dataModel:dataModel)
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
func onDocumentCropped(dataModel: RemoteProcessingModel) {
|
|
320
|
+
public func onDocumentCropped(dataModel: RemoteProcessingModel) {
|
|
321
321
|
triggerEvent(eventName:"onDocumentCropped",dataModel:dataModel)
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
func onUploadFailed(dataModel: RemoteProcessingModel) {
|
|
324
|
+
public func onUploadFailed(dataModel: RemoteProcessingModel) {
|
|
325
325
|
triggerEvent(eventName:"onUploadFailed",dataModel:dataModel)
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
|
|
328
|
+
public func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
|
|
329
329
|
motion: MotionType,
|
|
330
330
|
zoom: ZoomType,
|
|
331
331
|
isCentered: Bool,) {
|
|
@@ -335,42 +335,42 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
335
335
|
if (zoom == ZoomType.ZOOM_IN) {
|
|
336
336
|
self.start = false
|
|
337
337
|
self.infoLabel?.text = "Move ID Closer"
|
|
338
|
-
self.infoImage!.image = UIImage(named: "zoom_in")
|
|
338
|
+
self.infoImage!.image = UIImage(named: "zoom_in", in: Bundle.module, compatibleWith: nil)
|
|
339
339
|
}
|
|
340
340
|
if (zoom == ZoomType.ZOOM_OUT) {
|
|
341
341
|
self.start = false
|
|
342
342
|
self.infoLabel?.text = "Move ID Further"
|
|
343
|
-
self.infoImage!.image = UIImage(named: "zoom_out")
|
|
343
|
+
self.infoImage!.image = UIImage(named: "zoom_out", in: Bundle.module, compatibleWith: nil)
|
|
344
344
|
}
|
|
345
345
|
} else if (motion != MotionType.SENDING && motion != MotionType.NO_DETECT) {
|
|
346
346
|
self.start = false
|
|
347
347
|
self.infoLabel?.text = "Please Hold Your Hand"
|
|
348
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
348
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
349
349
|
} else if brightnessEvents != BrightnessEvents.Good {
|
|
350
350
|
if brightnessEvents == BrightnessEvents.TooDark {
|
|
351
351
|
self.start = false
|
|
352
352
|
self.infoLabel?.text = "Please increase the lighting"
|
|
353
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
353
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
354
354
|
}
|
|
355
355
|
if brightnessEvents == BrightnessEvents.TooBright {
|
|
356
356
|
self.start = false
|
|
357
357
|
self.infoLabel?.text = "Please reduce the lighting"
|
|
358
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
358
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
359
359
|
}
|
|
360
360
|
} else {
|
|
361
361
|
if (motion == MotionType.SENDING && zoom == ZoomType.SENDING && brightnessEvents == BrightnessEvents.Good) {
|
|
362
362
|
self.start = false
|
|
363
363
|
self.infoLabel?.text = "Hold Steady"
|
|
364
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
364
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
365
365
|
}
|
|
366
366
|
if (motion == MotionType.NO_DETECT && zoom == ZoomType.NO_DETECT) {
|
|
367
367
|
self.start = false
|
|
368
368
|
self.infoLabel?.text = "Please present ID"
|
|
369
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
369
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
370
370
|
} else if(!isCentered){
|
|
371
371
|
self.start = false
|
|
372
372
|
self.infoLabel?.text = " Please center your card"
|
|
373
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
373
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
} else {
|
|
@@ -418,7 +418,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
418
418
|
|
|
419
419
|
|
|
420
420
|
func playVideoInView(videoName: String, ofType fileType: String, in view: UIView, fullscreen: Bool) {
|
|
421
|
-
guard let path = Bundle.
|
|
421
|
+
guard let path = Bundle.module.path(forResource: videoName, ofType: fileType) else {
|
|
422
422
|
print("Video file not found")
|
|
423
423
|
return
|
|
424
424
|
}
|