assentify-sdk-react-native 1.0.0-Beta.4 → 1.0.0-Beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Package.swift +172 -0
- package/README.md +124 -32
- package/android/build.gradle +1 -6
- package/android/src/main/java/com/assentifysdk/AssentifySdkModule.kt +48 -9
- package/android/src/main/java/com/assentifysdk/FlowActivity.kt +75 -7
- package/android/src/main/java/com/assentifysdk/ScanIDActivity.kt +67 -6
- package/android/src/main/java/com/assentifysdk/ScanPassportActivity.kt +53 -1
- package/android/src/main/res/layout/activity_scan.xml +45 -57
- package/ios/AssentifySdkBaseModule.swift +1 -0
- package/ios/NativeAssentifySdk.mm +19 -2
- package/ios/NativeAssentifySdk.swift +151 -25
- package/ios/UIComponents/RNPassportScanner.swift +4 -3
- package/ios/View/AssentifySdkEventEmitting.swift +10 -0
- package/ios/View/DataDecoder.swift +16 -16
- package/ios/View/FaceMatchController.swift +51 -51
- package/ios/View/IDCardController.swift +93 -37
- package/ios/View/OtherController.swift +33 -33
- package/ios/View/PassportController.swift +84 -36
- package/ios/View/QrController.swift +10 -10
- package/ios/View/UI.swift +77 -26
- package/lib/commonjs/AssentifyProvider.js +3 -0
- package/lib/commonjs/AssentifyProvider.js.map +1 -1
- package/lib/commonjs/AssentifyWrapper.js +4 -4
- package/lib/commonjs/AssentifyWrapper.js.map +1 -1
- package/lib/commonjs/ClickFontWeightType.js +14 -0
- package/lib/commonjs/ClickFontWeightType.js.map +1 -0
- package/lib/commonjs/FlowStepperType.js +11 -0
- package/lib/commonjs/FlowStepperType.js.map +1 -0
- package/lib/commonjs/Language.js +5 -1
- package/lib/commonjs/Language.js.map +1 -1
- package/lib/commonjs/ValidationStyleType.js +11 -0
- package/lib/commonjs/ValidationStyleType.js.map +1 -0
- package/lib/commonjs/index.js +36 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/AssentifyProvider.js +4 -0
- package/lib/module/AssentifyProvider.js.map +1 -1
- package/lib/module/AssentifyWrapper.js +4 -4
- package/lib/module/AssentifyWrapper.js.map +1 -1
- package/lib/module/ClickFontWeightType.js +8 -0
- package/lib/module/ClickFontWeightType.js.map +1 -0
- package/lib/module/FlowStepperType.js +5 -0
- package/lib/module/FlowStepperType.js.map +1 -0
- package/lib/module/Language.js +4 -0
- package/lib/module/Language.js.map +1 -1
- package/lib/module/ValidationStyleType.js +5 -0
- package/lib/module/ValidationStyleType.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/babel.config.d.ts +0 -1
- package/lib/typescript/example/babel.config.d.ts +36 -5
- package/lib/typescript/example/babel.config.d.ts.map +1 -1
- package/lib/typescript/example/metro.config.d.ts +9 -1
- package/lib/typescript/example/metro.config.d.ts.map +1 -1
- package/lib/typescript/example/react-native.config.d.ts +34 -3
- package/lib/typescript/example/react-native.config.d.ts.map +1 -1
- package/lib/typescript/example/src/App.d.ts.map +1 -1
- package/lib/typescript/example/src/Home.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts +2 -2
- package/lib/typescript/lib/commonjs/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ClickFontWeightType.d.ts +9 -0
- package/lib/typescript/lib/commonjs/ClickFontWeightType.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/FlowStepperType.d.ts +6 -0
- package/lib/typescript/lib/commonjs/FlowStepperType.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Language.d.ts +6 -0
- package/lib/typescript/lib/commonjs/ValidationStyleType.d.ts +6 -0
- package/lib/typescript/lib/commonjs/ValidationStyleType.d.ts.map +1 -0
- package/lib/typescript/lib/module/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts +2 -2
- package/lib/typescript/lib/module/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/lib/module/ClickFontWeightType.d.ts +8 -0
- package/lib/typescript/lib/module/ClickFontWeightType.d.ts.map +1 -0
- package/lib/typescript/lib/module/FlowStepperType.d.ts +5 -0
- package/lib/typescript/lib/module/FlowStepperType.d.ts.map +1 -0
- package/lib/typescript/lib/module/Language.d.ts +6 -0
- package/lib/typescript/lib/module/ValidationStyleType.d.ts +5 -0
- package/lib/typescript/lib/module/ValidationStyleType.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +5 -2
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyWrapper.d.ts +6 -2
- package/lib/typescript/src/AssentifyWrapper.d.ts.map +1 -1
- package/lib/typescript/src/ClickFontWeightType.d.ts +9 -0
- package/lib/typescript/src/ClickFontWeightType.d.ts.map +1 -0
- package/lib/typescript/src/FlowStepperType.d.ts +6 -0
- package/lib/typescript/src/FlowStepperType.d.ts.map +1 -0
- package/lib/typescript/src/Language.d.ts +5 -0
- package/lib/typescript/src/Language.d.ts.map +1 -1
- package/lib/typescript/src/ValidationStyleType.d.ts +6 -0
- package/lib/typescript/src/ValidationStyleType.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +63 -10
- package/src/AssentifyProvider.tsx +341 -305
- package/src/AssentifyWrapper.ts +47 -6
- package/src/ClickFontWeightType.ts +10 -0
- package/src/FlowStepperType.ts +7 -0
- package/src/Language.ts +7 -0
- package/src/ValidationStyleType.ts +7 -0
- package/src/index.ts +3 -0
- package/src/types.ts +1 -0
- package/assentify-sdk.podspec +0 -44
- package/lib/typescript/example/src/navigator.d.ts +0 -4
- package/lib/typescript/example/src/navigator.d.ts.map +0 -1
|
@@ -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,16 +170,19 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
func onLivenessUpdate(dataModel: RemoteProcessingModel) {
|
|
173
|
+
public func onLivenessUpdate(dataModel: RemoteProcessingModel, image: UIImage?) {
|
|
174
174
|
triggerEvent(eventName:"onLivenessUpdate",dataModel:dataModel)
|
|
175
175
|
DispatchQueue.main.async {
|
|
176
|
+
self.scanID?.retryLiveness();
|
|
176
177
|
self.start = false;
|
|
178
|
+
if( self.popUpMessage != nil){
|
|
177
179
|
self.popUpMessage!.removeFromSuperview();
|
|
180
|
+
}
|
|
178
181
|
self.popUpMessage = showPopUpMessage(view: self.view, title: "Please use your original physical ID card, not a photo or copy.", subTitle: "Please real ID (Not copy)",initialTextColorHex:self.processingColor,initialBackgroundColorHex:self.holdHandColor, iconName: "id_warning", isGif: false,target: self, action: #selector(self.dismissPopUpMessage))
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
|
|
182
|
-
func onWrongTemplate(dataModel:RemoteProcessingModel) {
|
|
185
|
+
public func onWrongTemplate(dataModel:RemoteProcessingModel) {
|
|
183
186
|
triggerEvent(eventName:"onWrongTemplate",dataModel:dataModel)
|
|
184
187
|
DispatchQueue.main.async {
|
|
185
188
|
self.start = false;
|
|
@@ -187,21 +190,21 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
187
190
|
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
191
|
}
|
|
189
192
|
}
|
|
190
|
-
func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
|
|
193
|
+
public func onClipPreparationComplete(dataModel: RemoteProcessingModel) {
|
|
191
194
|
triggerEvent(eventName:"onClipPreparationComplete",dataModel:dataModel)
|
|
192
195
|
}
|
|
193
196
|
|
|
194
|
-
func onStatusUpdated(dataModel: RemoteProcessingModel) {
|
|
197
|
+
public func onStatusUpdated(dataModel: RemoteProcessingModel) {
|
|
195
198
|
triggerEvent(eventName:"onStatusUpdated",dataModel:dataModel)
|
|
196
199
|
}
|
|
197
200
|
|
|
198
|
-
func onUpdated(dataModel: RemoteProcessingModel) {
|
|
201
|
+
public func onUpdated(dataModel: RemoteProcessingModel) {
|
|
199
202
|
triggerEvent(eventName:"onUpdated",dataModel:dataModel)
|
|
200
203
|
}
|
|
201
204
|
|
|
202
205
|
|
|
203
206
|
|
|
204
|
-
func onComplete(dataModel: IDResponseModel ,isFrontPage:Bool,isLastPage:Bool,classifiedTemplate: String) {
|
|
207
|
+
public func onComplete(dataModel: IDResponseModel ,isFrontPage:Bool,isLastPage:Bool,classifiedTemplate: String) {
|
|
205
208
|
|
|
206
209
|
self.triggerCompleteEvent(eventName:"onComplete",dataModel:dataModel.iDExtractedModel,isFrontPage:isFrontPage,isLastPage: isLastPage ,classifiedTemplate:classifiedTemplate)
|
|
207
210
|
|
|
@@ -280,52 +283,105 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
280
283
|
|
|
281
284
|
}
|
|
282
285
|
|
|
283
|
-
func onCardDetected(dataModel: RemoteProcessingModel) {
|
|
286
|
+
public func onCardDetected(dataModel: RemoteProcessingModel) {
|
|
284
287
|
triggerEvent(eventName:"onCardDetected",dataModel:dataModel)
|
|
285
288
|
}
|
|
286
289
|
|
|
287
|
-
func onMrzExtracted(dataModel: RemoteProcessingModel) {
|
|
290
|
+
public func onMrzExtracted(dataModel: RemoteProcessingModel) {
|
|
288
291
|
triggerEvent(eventName:"onMrzExtracted",dataModel:dataModel)
|
|
289
292
|
}
|
|
290
293
|
|
|
291
|
-
func onMrzDetected(dataModel: RemoteProcessingModel) {
|
|
294
|
+
public func onMrzDetected(dataModel: RemoteProcessingModel) {
|
|
292
295
|
triggerEvent(eventName:"onMrzDetected",dataModel:dataModel)
|
|
293
296
|
}
|
|
294
297
|
|
|
295
|
-
func onNoMrzDetected(dataModel: RemoteProcessingModel) {
|
|
298
|
+
public func onNoMrzDetected(dataModel: RemoteProcessingModel) {
|
|
296
299
|
triggerEvent(eventName:"onNoMrzDetected",dataModel:dataModel)
|
|
297
300
|
}
|
|
298
301
|
|
|
299
302
|
|
|
300
|
-
func onFaceDetected(dataModel: RemoteProcessingModel) {
|
|
303
|
+
public func onFaceDetected(dataModel: RemoteProcessingModel) {
|
|
301
304
|
triggerEvent(eventName:"onFaceDetected",dataModel:dataModel)
|
|
302
305
|
}
|
|
303
306
|
|
|
304
|
-
func onNoFaceDetected(dataModel: RemoteProcessingModel) {
|
|
307
|
+
public func onNoFaceDetected(dataModel: RemoteProcessingModel) {
|
|
305
308
|
triggerEvent(eventName:"onNoFaceDetected",dataModel:dataModel)
|
|
306
309
|
}
|
|
307
310
|
|
|
308
|
-
func onFaceExtracted(dataModel: RemoteProcessingModel) {
|
|
311
|
+
public func onFaceExtracted(dataModel: RemoteProcessingModel) {
|
|
309
312
|
triggerEvent(eventName:"onFaceExtracted",dataModel:dataModel)
|
|
310
313
|
}
|
|
311
314
|
|
|
312
|
-
func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
|
|
315
|
+
public func onQualityCheckAvailable(dataModel: RemoteProcessingModel) {
|
|
313
316
|
triggerEvent(eventName:"onQualityCheckAvailable",dataModel:dataModel)
|
|
314
317
|
}
|
|
315
318
|
|
|
316
|
-
func onDocumentCaptured(dataModel: RemoteProcessingModel) {
|
|
319
|
+
public func onDocumentCaptured(dataModel: RemoteProcessingModel) {
|
|
317
320
|
triggerEvent(eventName:"onDocumentCaptured",dataModel:dataModel)
|
|
318
321
|
}
|
|
319
322
|
|
|
320
|
-
func onDocumentCropped(dataModel: RemoteProcessingModel) {
|
|
323
|
+
public func onDocumentCropped(dataModel: RemoteProcessingModel) {
|
|
321
324
|
triggerEvent(eventName:"onDocumentCropped",dataModel:dataModel)
|
|
322
325
|
}
|
|
323
326
|
|
|
324
|
-
func onUploadFailed(dataModel: RemoteProcessingModel) {
|
|
327
|
+
public func onUploadFailed(dataModel: RemoteProcessingModel) {
|
|
325
328
|
triggerEvent(eventName:"onUploadFailed",dataModel:dataModel)
|
|
326
329
|
}
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
private var livenessActive = false
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
public func onLivenessInstruction(instruction: IdLivenessInstruction, progress: Int) {
|
|
337
|
+
DispatchQueue.main.async {
|
|
338
|
+
// the liveness owns the message while it runs (not after "keep holding" / "barcode read": the result is coming)
|
|
339
|
+
self.livenessActive = instruction != .keepHolding && instruction != .barcodeRead
|
|
340
|
+
|
|
341
|
+
var text: String
|
|
342
|
+
switch instruction {
|
|
343
|
+
// ---------- position ----------
|
|
344
|
+
case .placeCard: text = "Place the card\nin the frame"
|
|
345
|
+
// ---------- flat hold ----------
|
|
346
|
+
case .keepSteady: text = "Keep it steady"
|
|
347
|
+
case .keepFlat: text = "Hold the card flat"
|
|
348
|
+
case .adjustPosition: text = "Tilt slightly\nto avoid glare"
|
|
349
|
+
// ---------- light ----------
|
|
350
|
+
case .doNotMove: text = "Keep it steady\nLight is on"
|
|
351
|
+
// ---------- tilt ----------
|
|
352
|
+
case .liftRight: text = "Lift the right edge\ntoward you"
|
|
353
|
+
case .liftTop: text = "Lift the top edge\ntoward you"
|
|
354
|
+
case .liftBottom: text = "Lift the bottom edge\ntoward you"
|
|
355
|
+
case .aBitMore: text = "A bit more\nand hold"
|
|
356
|
+
case .holdThere: text = "Hold it there"
|
|
357
|
+
case .otherEdge: text = "Lift the other edge"
|
|
358
|
+
case .pickUp: text = "Hold the card\nin your hand"
|
|
359
|
+
// ---------- done ----------
|
|
360
|
+
case .keepHolding: text = "Keep holding\nAlmost done"
|
|
361
|
+
// ---------- ID back: the barcode ----------
|
|
362
|
+
case .readingBarcode: text = "Reading the barcode\nKeep it steady"
|
|
363
|
+
case .barcodeRead: text = "Barcode read"
|
|
364
|
+
// ---------- pauses (the SDK continues by itself after a few seconds) ----------
|
|
365
|
+
case .holdInHand: text = "Hold it in your hand\nnot on the table"
|
|
366
|
+
case .phoneTurned: text = "Keep the phone still\nTilt the card"
|
|
367
|
+
case .tooBright: text = "Too much light\nMove to the shade"
|
|
368
|
+
@unknown default: text = ""
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// the tilt progress (0..100), on its own line, only while the card is being tilted
|
|
372
|
+
switch instruction {
|
|
373
|
+
case .liftRight, .liftTop, .liftBottom, .aBitMore, .holdThere, .otherEdge, .pickUp:
|
|
374
|
+
text += "\n\(progress)%"
|
|
375
|
+
default:
|
|
376
|
+
break
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
self.infoLabel?.text = text
|
|
380
|
+
self.infoImage?.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
381
|
+
}
|
|
382
|
+
}
|
|
327
383
|
|
|
328
|
-
func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
|
|
384
|
+
public func onEnvironmentalConditionsChange( brightnessEvents: BrightnessEvents,
|
|
329
385
|
motion: MotionType,
|
|
330
386
|
zoom: ZoomType,
|
|
331
387
|
isCentered: Bool,) {
|
|
@@ -335,42 +391,42 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
335
391
|
if (zoom == ZoomType.ZOOM_IN) {
|
|
336
392
|
self.start = false
|
|
337
393
|
self.infoLabel?.text = "Move ID Closer"
|
|
338
|
-
self.infoImage!.image = UIImage(named: "zoom_in")
|
|
394
|
+
self.infoImage!.image = UIImage(named: "zoom_in", in: Bundle.module, compatibleWith: nil)
|
|
339
395
|
}
|
|
340
396
|
if (zoom == ZoomType.ZOOM_OUT) {
|
|
341
397
|
self.start = false
|
|
342
398
|
self.infoLabel?.text = "Move ID Further"
|
|
343
|
-
self.infoImage!.image = UIImage(named: "zoom_out")
|
|
399
|
+
self.infoImage!.image = UIImage(named: "zoom_out", in: Bundle.module, compatibleWith: nil)
|
|
344
400
|
}
|
|
345
401
|
} else if (motion != MotionType.SENDING && motion != MotionType.NO_DETECT) {
|
|
346
402
|
self.start = false
|
|
347
403
|
self.infoLabel?.text = "Please Hold Your Hand"
|
|
348
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
404
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
349
405
|
} else if brightnessEvents != BrightnessEvents.Good {
|
|
350
406
|
if brightnessEvents == BrightnessEvents.TooDark {
|
|
351
407
|
self.start = false
|
|
352
408
|
self.infoLabel?.text = "Please increase the lighting"
|
|
353
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
409
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
354
410
|
}
|
|
355
411
|
if brightnessEvents == BrightnessEvents.TooBright {
|
|
356
412
|
self.start = false
|
|
357
413
|
self.infoLabel?.text = "Please reduce the lighting"
|
|
358
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
414
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
359
415
|
}
|
|
360
416
|
} else {
|
|
361
417
|
if (motion == MotionType.SENDING && zoom == ZoomType.SENDING && brightnessEvents == BrightnessEvents.Good) {
|
|
362
418
|
self.start = false
|
|
363
419
|
self.infoLabel?.text = "Hold Steady"
|
|
364
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
420
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
365
421
|
}
|
|
366
422
|
if (motion == MotionType.NO_DETECT && zoom == ZoomType.NO_DETECT) {
|
|
367
423
|
self.start = false
|
|
368
424
|
self.infoLabel?.text = "Please present ID"
|
|
369
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
425
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
370
426
|
} else if(!isCentered){
|
|
371
427
|
self.start = false
|
|
372
428
|
self.infoLabel?.text = " Please center your card"
|
|
373
|
-
self.infoImage!.image = UIImage(named: "info_icon")
|
|
429
|
+
self.infoImage!.image = UIImage(named: "info_icon", in: Bundle.module, compatibleWith: nil)
|
|
374
430
|
}
|
|
375
431
|
}
|
|
376
432
|
} else {
|
|
@@ -418,7 +474,7 @@ class IDCardController: UIViewController ,ScanIDCardDelegate , ChildViewControll
|
|
|
418
474
|
|
|
419
475
|
|
|
420
476
|
func playVideoInView(videoName: String, ofType fileType: String, in view: UIView, fullscreen: Bool) {
|
|
421
|
-
guard let path = Bundle.
|
|
477
|
+
guard let path = Bundle.module.path(forResource: videoName, ofType: fileType) else {
|
|
422
478
|
print("Video file not found")
|
|
423
479
|
return
|
|
424
480
|
}
|