iOS SDK
Getting Started
Latest release: version 3.0.5
Requirements
- iOS 11.0 and higher
- Internet connection
- Swift Version should be latest
Resources
- Integration Sample: iOS Sample App
Installation
It’s always recommended to use the updated version and run on physical device to get real results.
Cocoapods:
1. Add following pod to your Podfile
pod 'Facia', :tag => '3.0.5', :git => "https://github.com/FaciaMobile/ios-core"
Permissions:
Application Info.plist must contain Privacy - Camera Usage Description
with corresponding explanation to end-user about how the app will use these permissions
Basic Usage
Make sure you have obtained authorization credentials before proceeding. You can get Login credentials (email & password) by contacting to Facia support team
Authorization
For authorization, Facia's SDKs require Access token. You can get access token from the API: https://app.facia.ai/backend/api/transaction/get-access-token/
Request Object
Parameters | Description |
---|---|
Required: Yes Type: String | |
password | Required: Yes Type: String |
Configuration
The Facia’s mobile SDKs can be configured on the basis of parameters provided in the config object. The details of parameters can be found here.
let config = [
"showConsent" : true,
"showVerificationType" : true,
"showResult" : true
]
Initialisation
Facia’s mobile SDK can be initialised by using the given method and passing activity instance, token, config object and callback listener as the parameters.
let facia = Facia()
facia.createRequest(parentViewController: self,
accessToken: "ACCESS_TOKEN",
configs: config) { result in
print(result)
}
Callbacks
The SDK receive callbacks on termination, whether after the request completion or if the journey is left mid-way. The callbacks are received as
facia.createRequest(parentViewController: self,
accessToken: "ACCESS_TOKEN",
configs: config) { result in
let reponse = result as! NSDictionary
}
Callback Handling
All the callbacks can be handled inside the client’s calling activity. The responses and callback handling can be seen below.
On SDK Completion
3D Liveness
if reponse?.value(forKey: "event") as? String == "liveness.verified" {
// Liveness Accepted Callback
}
else if reponse?.value(forKey: "event") as? String == "liveness.unverified"{
// Liveness Declined Callback
}
Photo ID Match
if reponse?.value(forKey: "event") as? String == "photo_id.match_success"{
// Photo Id Matched Success Callback.
}
else if reponse?.value(forKey: "event") as? String == "photo_id.match_failure"{
// Photo Id Matched Failure Callback.
}
On SDK Error
if reponse?.value(forKey: "event") as? String == "error.occurred "{
// The error.occured event occurs when the unknown error occured.
}
else if reponse?.value(forKey: "event") as? String == "request.timeout"{
// This will occur if request has timed-out.
}
else if reponse?.value(forKey: "event") as? String == "permission.denied"{
// This event is returned if the user did not give camera and other permissions to sdk.
}
else if reponse?.value(forKey: "event") as? String == "verification.cancelled"{
//This event occurs when the end-user does not agree to the terms and conditions and also occur if in-between user cancel verification process.
}
else {
// Some error has been occured during the verification process
}
Customisation
Facia supports a set of customisation options that will influence the appearance of the mobile SDK.
Colours
The colour of buttons and font can be customized using the following parameters with Facia's instance.
facia.face_detected_oval_color = .green
facia.face_not_detected_oval_color = .red
facia.dark_text_color = .black
facia.light_text_color = .grey
facia.ql_instruction_bg_color = .lightgrey
facia.button_bg_color = .blue
facia.button_text_color = .white
facia.dialog_button_text_color = .blue
Changelog
Date | SDK Versions | Changes |
---|---|---|
Mar 15, 2024 | 3.0.5 | Update Swift Version. |
Mar 13, 2024 | 3.0.4 | Minor Tweaks. |
Feb 23, 2024 | 1.1.4 | Update Swift Version. |
Feb 23, 2024 | 1.1.3 | Improve instructions flow. |
Dec 08, 2023 | 1.1.2 | Improved Responsiveness. |
Nov 27, 2023 | 1.1.1 | Improved design & Liveness flow. |
Nov 17, 2023 | 1.1.0 | Improved Passive Liveness flow & design. |
Nov 02, 2023 | 1.0.8 | Improved functionality and design |
Oct 23, 2023 | 1.0.7 | Improve Result API Flow |
Oct 19, 2023 | 1.0.6 | 3D Liveness & Photo ID Match features are added. |