Skip to content

Commit 74b3962

Browse files
Merge branch 'release/5.6.1'
2 parents 2e63f21 + 90ddd8e commit 74b3962

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

IDCheckioSDK_Sample/IDCheckioSDK_Sample.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@
381381
"${PODS_ROOT}/IDCheckIOSDK/res/IDCheckIOSDK.framework",
382382
"${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework",
383383
"${BUILT_PRODUCTS_DIR}/Moya/Moya.framework",
384-
"${BUILT_PRODUCTS_DIR}/Result/Result.framework",
385384
"${BUILT_PRODUCTS_DIR}/SocketRocket/SocketRocket.framework",
386385
"${BUILT_PRODUCTS_DIR}/SwiftProtobuf/SwiftProtobuf.framework",
387386
"${BUILT_PRODUCTS_DIR}/SwiftyUserDefaults/SwiftyUserDefaults.framework",
@@ -392,7 +391,6 @@
392391
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IDCheckIOSDK.framework",
393392
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainAccess.framework",
394393
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework",
395-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework",
396394
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SocketRocket.framework",
397395
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftProtobuf.framework",
398396
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyUserDefaults.framework",

IDCheckioSDK_Sample/IDCheckioSDK_Sample/ViewControllers/HomeViewController.swift

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import IDCheckIOSDK
1212
typealias IDCheckIOResultCompletionBlock = (_ result: IdcheckioResult?, _ error: Error?) -> Void
1313

1414
class HomeViewController: UIViewController {
15-
15+
1616
// MARK: Outlets
1717
@IBOutlet private weak var versionLabel: UILabel! {
1818
didSet {
@@ -22,22 +22,22 @@ class HomeViewController: UIViewController {
2222
@IBOutlet private weak var idSwitch: UISwitch!
2323
@IBOutlet private weak var livenessSwitch: UISwitch!
2424
@IBOutlet private weak var sessionTypeSwitch: UISwitch!
25-
25+
2626
// MARK: Properties
2727
var selectedParams: SDKParams?
2828
var previousResult: IdcheckioResult?
29-
29+
3030
// MARK: Methods
3131
override func viewDidLoad() {
3232
super.viewDidLoad()
3333
self.sdkInitialization()
3434
}
35-
35+
3636
private func sdkInitialization() {
3737
// Optimize SDK loading using this line:
3838
Idcheckio.shared.preload(extractData: true)
3939
Idcheckio.shared.delegate = self
40-
40+
4141
// Activate SDK with your licence file (name it "licence.axt" and place it in the root of the project folder)
4242
Idcheckio.shared.activate(withLicenseFilename: "licence", extractData: true, sdkEnvironment: .demo) { (error: IdcheckioError?) in
4343
if let error = error {
@@ -53,26 +53,26 @@ class HomeViewController: UIViewController {
5353
print("Initialization successed !")
5454
}
5555
}
56-
56+
5757
// MARK: Actions
5858
@IBAction func startButtonTouchUpInside(_ sender: Any) {
59-
59+
6060
if let params = selectedParams {
6161
try? Idcheckio.shared.setParams(params)
6262
launchSession(online: sessionTypeSwitch.isOn)
6363
} else {
6464
showAlert(with: "Please select a document type to start a session.")
6565
}
6666
}
67-
67+
6868
@IBAction func clearContextTouchUpInside(_ sender: Any) {
6969
previousResult = nil
7070
showAlert(with: "Context cleared !")
7171
}
72-
72+
7373
@IBAction func docTypeSwitchValueChanged(_ sender: Any) {
7474
guard let switchSender = sender as? UISwitch else { return }
75-
75+
7676
if switchSender.isOn {
7777
switch switchSender {
7878
case idSwitch:
@@ -84,7 +84,7 @@ class HomeViewController: UIViewController {
8484
} else {
8585
selectedParams = nil
8686
}
87-
87+
8888
[idSwitch, livenessSwitch].filter({ $0 != switchSender }).forEach { $0?.setOn(false, animated: true) }
8989
}
9090
}
@@ -96,14 +96,14 @@ extension HomeViewController {
9696
let livenessToken: String = "YOUR_LIVENESS_SESSION_TOKEN"
9797
Idcheckio.shared.extraParameters.token = livenessToken
9898
}
99-
100-
99+
100+
101101
DispatchQueue.main.async { [weak self, online] in
102102
let viewController = UIViewController()
103103
viewController.modalPresentationStyle = .fullScreen
104-
104+
105105
let cameraView = IdcheckioView(frame: .zero)
106-
106+
107107
cameraView.translatesAutoresizingMaskIntoConstraints = false
108108
viewController.view.frame = self?.view.frame ?? .zero
109109
viewController.view.addSubview(cameraView)
@@ -112,7 +112,7 @@ extension HomeViewController {
112112
cameraView.trailingAnchor.constraint(equalTo: viewController.view.trailingAnchor).isActive = true
113113
cameraView.topAnchor.constraint(equalTo: viewController.view.topAnchor).isActive = true
114114
cameraView.bottomAnchor.constraint(equalTo: viewController.view.bottomAnchor).isActive = true
115-
115+
116116
self?.present(viewController, animated: true, completion: { [self, cameraView, online] in
117117
if online {
118118
let referenceTaskUid = self?.previousResult?.taskUid
@@ -122,11 +122,19 @@ extension HomeViewController {
122122
Idcheckio.shared.startOnline(with: cameraView,
123123
cisContext: context,
124124
completion: { [weak self] (error) in
125-
self?.display(result: nil, error: error)
125+
if let error = error {
126+
self?.dismiss(animated: true) {
127+
self?.display(result: nil, error: error)
128+
}
129+
}
126130
})
127131
} else {
128132
Idcheckio.shared.start(with: cameraView, completion: { [weak self] (error) in
129-
self?.display(result: nil, error: error)
133+
if let error = error {
134+
self?.dismiss(animated: true) {
135+
self?.display(result: nil, error: error)
136+
}
137+
}
130138
})
131139
}
132140
})
@@ -135,7 +143,7 @@ extension HomeViewController {
135143
}
136144

137145
extension HomeViewController: IdcheckioDelegate {
138-
146+
139147
func idcheckioFinishedWithResult(_ result: IdcheckioResult?, error: Error?) {
140148
previousResult = result
141149
DispatchQueue.main.async { [weak self, result, error] in
@@ -144,11 +152,11 @@ extension HomeViewController: IdcheckioDelegate {
144152
})
145153
}
146154
}
147-
155+
148156
func idcheckioDidSendEvent(interaction: IdcheckioInteraction, msg: IdcheckioMsg?) {
149157
//Nothing to do...
150158
}
151-
159+
152160
func display(result: IdcheckioResult?, error: Error?) {
153161
var message: String = "Thank you for your session !"
154162
if let document = result?.document {
@@ -161,7 +169,7 @@ extension HomeViewController: IdcheckioDelegate {
161169
} else if let error = error {
162170
message = error.localizedDescription
163171
}
164-
172+
165173
showAlert(with: message)
166174
}
167175
}

IDCheckioSDK_Sample/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use_frameworks!
88

99
target 'IDCheckioSDK_Sample' do
1010
# Application Pods
11-
pod 'IDCheckIOSDK', '5.4.1'
11+
pod 'IDCheckIOSDK', '5.6.1'
1212

1313
end
1414

0 commit comments

Comments
 (0)