assentify-sdk-react-native 1.0.0-Beta.22 → 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 +7 -32
- package/android/build.gradle +0 -5
- package/ios/AssentifySdkBaseModule.swift +1 -0
- package/ios/NativeAssentifySdk.swift +9 -7
- 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/module/AssentifyProvider.js +4 -0
- package/lib/module/AssentifyProvider.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/module/AssentifyProvider.d.ts.map +1 -1
- package/lib/typescript/src/AssentifyProvider.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/AssentifyProvider.tsx +341 -305
- 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,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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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(
|
|
9
|
-
|
|
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
|
-
|
|
18
|
-
backButton.
|
|
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.
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
navigationItem.leftBarButtonItem =
|
|
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
|
-
|
|
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.
|
|
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 {
|