Skip to main content

iOS SDK

Getting Started

Latest release: version 3.0.5

Requirements

  • iOS 11.0 and higher
  • Internet connection
  • Swift Version should be latest

Resources

Installation

tip

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

Note

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

ParametersDescription
emailRequired: Yes
Type: String
passwordRequired: 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

DateSDK VersionsChanges
Mar 15, 20243.0.5Update Swift Version.
Mar 13, 20243.0.4Minor Tweaks.
Feb 23, 20241.1.4Update Swift Version.
Feb 23, 20241.1.3Improve instructions flow.
Dec 08, 20231.1.2Improved Responsiveness.
Nov 27, 20231.1.1Improved design & Liveness flow.
Nov 17, 20231.1.0Improved Passive Liveness flow & design.
Nov 02, 20231.0.8Improved functionality and design
Oct 23, 20231.0.7Improve Result API Flow
Oct 19, 20231.0.63D Liveness & Photo ID Match features are added.