Orba One
Search…
iOS
How to install Orba One's Document and Video Capture for Identity Verification in Swift/iOS.

1. Platform Requirements

The SDK supports the following configurations:
  • Supports iOS 13+
  • Supports Xcode 11.5+
  • Supports the following presentation styles:
    • Fullscreen for iPhones
    • Fullscreen and Form Sheet for iPads

2. Install as a CocoaPod

To install the SDK using CocoaPods, add the following to the application's podfile:
1
pod 'OrbaOneSdk'
Copied!
Then run pod install to retrieve the sdk.

3. App Permissions

The Orba One SDK requires that the following permissions be added to the application's info.plist file:
1
<key>NSCameraUsageDescription</key>
2
<string>Required for Facial and Document capture.</string>
3
<key>NSMicrophoneUsageDescription</key>
4
<string>Required for Audio capture.</string>
Copied!

4. Configuring the SDK

The Orba One SDK uses a publishable api key and an applicant id that you can obtain from your vendor dashboard. Your publishable api key will be needed in order to initialize the SDK in your mobile app. A sample implementation is shown below.
1
import OrbaOneSdk
2
3
let config = OrbaOneConfig().setApiKey("publishable-api-key").setApplicantId("applicant-id").setFlow([.INTRO, .ID, .FACESCAN]).build()
4
do {
5
let sdk = try OrbaOneFlow(configuration: config).with(responseHandler: {response in
6
switch response {
7
case .success(let result):
8
print("Flow completed successfully: \(result)")
9
case .failure(let error):
10
print("Flow cancelled by the user: \(error)")
11
case .start:
12
print("Flow started.")
13
case .error(let error):
14
print("Flow encounterd an error: \(error)")
15
}
16
})
17
18
var presentationStyle: UIModalPresentationStyle = .fullScreen
19
20
if UIDevice.current.userInterfaceIdiom == .pad {
21
presentationStyle = .formSheet
22
}
23
24
try sdk.startVerification(origin: self, style: presentationStyle)
25
} catch let error {
26
print("Flow not started. Error: \(error)")
27
}
Copied!

5. SDK Responses

The Orba One SDK exposes four callbacks to the mobile app. Each can be used to coordinate user feedback at various stages of the SDK's lifecycle.
1
{response in
2
switch response {
3
case .success(let result):
4
// The mobile app user has completed all the required steps and is returned to the view that initiated the SDK.
5
print("Flow completed successfully: \(result)")
6
case .failure(let error):
7
// The mobile app user cancelled the verification flow by returning to view that initiated the SDK.
8
print("Flow cancelled by the user: \(error)")
9
case .start:
10
// A new verification flow was started by the user.
11
print("Flow started.")
12
case .error(let error):
13
// An error occured while the verification flow was in progress.
14
switch error {
15
case .exception(withMessage: let message):
16
print("\(message)")
17
case .API_KEY_MISSING:
18
print("Publishable key missing.")
19
case .API_KEY_INVALID:
20
print("Publishable key is invalid.")
21
case .USER_INVALID:
22
print("Applicant id is invalid.")
23
case .USER_CANCELLED:
24
print("Applicant cancelled verification.")
25
case .API_NOT_AVAILABLE:
26
print("Orba One servers are unreachable.")
27
case .UPLOAD_INVALID:
28
print("Upload data is corrupted or missing meta data.")
29
@unknown default:
30
print("An unknown error occured.")
31
}
32
break;
33
}
34
}
Copied!

6. Customizing the Flow

To customize the verification flow, you can make use of the SDK's config builder function. All customization must be done before starting the verification.
1
let flowSteps: [Step] = [
2
Step.INTRO, // Welcome step - gives your user a short overview of the flow. [Optional, Default].
3
Step.ID, // Photo ID step - captures the user's identification document. [Default].
4
Step.FACESCAN, // Selfie Video step - captures a video of the user for liveness detection. [Default].
5
Step.COMPLETE // Final Step - informs the user that the verification process is completed. [Optional].
6
]
7
8
let config = OrbaOneConfig().setApiKey("publishable-api-key").setApplicantId("applicant-id").setFlow(flowSteps).build()
9
let sdk = try OrbaOneFlow(configuration: config)
10
try sdk.startVerification(origin: self)
Copied!

7. Customizing the Document Capture Step

To customize the document capture step, you can simply make use of the sdk's DocumentCaptureConfig builder class. By using this builder class, you are able to exclude specified documents and countries from the capture flow. All customization must be done before starting the flow.
1
let documentStep = DocumentCaptureConfig()
2
.excludeDocument([
3
.PASSPORT, // this will remove the Passport option
4
.DRIVERSLICENSE, // this will remove the Driver's License option
5
.NATIONALID // this will remove the National ID option
6
])
7
.excludeCountry([
8
.JM, // this will remove Jamaica from the list of available countries
9
.US // this will remove the United States from the list of available countries
10
]).build()
11
let config = OrbaOneConfig()
12
.setApiKey("publishable-api-key")
13
.setApplicantId("applicant-id")
14
.supportsDocument(documentStep)
15
.build()
16
let sdk = try OrbaOneFlow(configuration: config)
17
try sdk.startVerification(origin: self)
Copied!

8. Customizing the Theme

To ensure that Orba One fits in to your app's existing user experience, you can customize various colors by specifying a theme configuration.
1
let appearance = Theme(
2
colorPrimary: <UIColor>,
3
colorTextPrimary: <UIColor>,
4
colorButtonPrimary: <UIColor>,
5
colorButtonPrimaryText: <UIColor>,
6
colorButtonPrimaryPressed: <UIColor>,
7
enableDarkMode: <true | false>)
8
9
let config = OrbaOneConfig().setAppearance(appearance).build()
Copied!
colorPrimary: Defines the primary accent color for bullet points and highlights. colorTextPrimary: Defines the text color of Titles. colorButtonPrimary: Defines the background color of Primary Buttons and the text color of Secondary Buttons. colorButtonPrimaryText: Defines the text color of Primary Buttons. colorButtonPrimaryPressed: Defines the background color of Primary Buttons when pressed. enableDarkMode: Defines the dark mode allowed setting for the SDK.

Sample App

A sample app demonstrating the Orba One SDK's implementation has been included. See the SampleApp directory for the Swift implementation.

Support

Please post all issues through Github. If your query involves sensitive information, you may contact us at [email protected] with the subject IOS ISSUE: .
Last modified 3mo ago