Onfido

Version SwiftPM compatible Carthage incompatible License Platform

Overview

The Onfido iOS SDK provides a drop-in set of screens and tools for iOS applications to capture identity documents and selfie photos and videos for the purpose of identity verification.

It offers a number of benefits to help you create the best identity verification experience for your customers:

  • Carefully designed UI to guide your customers through the photo and video capture process
  • Modular design to help you seamlessly integrate the photo and video capture process into your application flow
  • Advanced image quality detection technology to ensure the quality of the captured images meets the requirement of the Onfido identity verification process, guaranteeing the best success rate
  • Direct image upload to the Onfido service, to simplify integration

Note: The SDK is only responsible for capturing and uploading document photos, live selfies, live videos and motion captures. You still need to access the Onfido API to manage applicants and Onfido Studio to build verification workflows.

Capture Document and face

Getting started

  • SDK supports iOS 11+
  • SDK supports Xcode 14+*
  • SDK has full bitcode support
  • SDK supports following presentation styles:
    • Only full screen style for iPhones
    • Full screen and form sheet styles for iPads

* The latest SDK version to support Xcode 11.5-12 is 22. There is a workaround for older versions of Xcode if required. Please contact support for more information.

The Onfido SDK requires CoreNFC to run. Since Xcode 12 there is a bug where libnfshared.dylib is missing from simulators. See Stack Overflow to solve this problem.

Even if you don't enable the NFC feature, Apple might ask you to provide a video to demonstrate NFC usage because NFC related code is part of the SDK binary regardless of runtime configuration. While we're working on a permanent solution for this problem, please download the video that has been shared in this post and send to Apple to proceed on your App Review process.

The following content assumes you're using our API v3 versions for backend calls. If you are currently using API v2 please refer to this migration guide for more information.

ℹ️

If you are integrating using Onfido Studio please see our Studio integration guide

1. Obtain an API token

In order to start integrating, you'll need an API token.

You can use our sandbox environment to test your integration. To use the sandbox, you'll need to generate a sandbox API token in your Onfido Dashboard.

Note: You must never use API tokens in the frontend of your application or malicious users could discover them in your source code. You should only use them on your server.

1.1 Regions

Onfido offers region-specific environments. Refer to the Regions section in our API documentation for token format and API base URL information.

2. Create an applicant

To create an applicant from your backend server, make a request to the 'create applicant' endpoint, using a valid API token.

Note: Different report types have different minimum requirements for applicant data. For a Document or Facial Similarity report the minimum applicant details required are first_name and last_name.

shell
Copy
$ curl https://api.onfido.com/v3/applicants \
    -H 'Authorization: Token token=<YOUR_API_TOKEN>' \
    -d 'first_name=John' \
    -d 'last_name=Smith'

The JSON response will return an id field containing a UUID that identifies the applicant. Once you pass the applicant ID to the SDK, documents and live photos and videos uploaded by that instance of the SDK will be associated with that applicant.

3. Configure the SDK with token

You'll need to generate and include an SDK token every time you initialize the SDK.

To generate an SDK token, make a request to the 'generate SDK token' endpoint.

shell
Copy
$ curl https://api.onfido.com/v3/sdk_token \
  -H 'Authorization: Token token=<YOUR_API_TOKEN>' \
  -F 'applicant_id=<APPLICANT_ID>' \
  -F 'application_id=<YOUR_APPLICATION_BUNDLE_IDENTIFIER>'
ParameterNotes
applicant_idrequired
Specifies the applicant for the SDK instance.
application_idrequired
The application ID (for iOS "application bundle ID") that was set up during development. For iOS, this is usually in the form com.your-company.app-name. Make sure to use a valid application_id or you'll receive a 401 error.

SDK tokens expire after 90 minutes.

Managing SDK Token Expiry with expireHandler

You can use the optional expireHandler parameter in the SDK token configurator function to generate and pass a new SDK token when it expires. This ensures the SDK continues its flow even after an SDK token has expired.

For example:

swift
Copy
func getSDKToken(_ completion: @escaping (String) -> Void) {
    // Your network request logic to retrieve SDK token goes here
    completion(myNewSDKtoken)
}

let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN>", expireHandler: getSDKToken)
Objective-C
Copy
-(void) getSDKToken: (void(^)(NSString *)) handler {
   // <Your network request logic to retrieve SDK token goes here>
   handler(sdkToken);
}

ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN" expireHandler:^(void (^ handler)(NSString *  expireHandler)) {
    [self getSDKToken:handler];
}];

4. App permissions

The SDK uses the device camera. You're required to have the following keys in your application's Info.plist file:

  • NSCameraUsageDescription
  • NSMicrophoneUsageDescription
xml
Copy
<key>NSCameraUsageDescription</key>
<string>Required for document and facial capture</string>
<key>NSMicrophoneUsageDescription</key>
<string>Required for video capture</string>

Note: All keys will be required for app submission.

5. Add the SDK dependency

Using Swift Package Manager

The SDK is available with Swift Package Manager and you can include it in your project by adding the following package repository URL:

https://github.com/onfido/onfido-ios-sdk.git

Using Cocoapods

The SDK is available on Cocoapods and you can include it in your projects by adding the following to your Podfile:

Ruby
Copy
pod 'Onfido'

Run pod install to get the SDK.

Manual installation

The SDK is available in the GitHub Releases tab where you can download the compressed framework. You can find the latest release here.

  1. Download the compressed debug zip file containing the Onfido.framework.
  2. Uncompress the zip file and then move the Onfido.framework artefact into your project.
  3. Add Onfido.framework located within your project to the Embedded binaries section in the General tab of your iOS app target.
  4. Open your app's project file in Xcode. Then select your app's target under target list.
  5. Next select the Build Phases tab and under the Embed Frameworks step add a new Run Script Phase. Name it Onfido Framework Archive.
  6. In the text area add the following code:
Bash
Copy
if [[ "$ACTION" != "install" ]]; then
    exit 0;
fi

FRAMEWORK_DIR="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
ONFIDO_FRAMEWORK="${FRAMEWORK_DIR}/Onfido.framework"

cd "${ONFIDO_FRAMEWORK}"

lipo -remove i386 Onfido -o Onfido
lipo -remove x86_64 Onfido -o Onfido

Non-Swift apps

If your app is not Swift based then you must create a new Swift file inside of your project. This file is required to force Xcode to package Swift runtime libraries required for the Onfido iOS SDK to run.

  1. Create a Swift file with the following contents:

    swift
    Copy
    import Foundation
    import AVFoundation
    import CoreImage
    import UIKit
    import Vision
    
    func fixLibSwiftOnoneSupport() {
        // from https://stackoverflow.com/a/54511127/2982993
        print("Fixes dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib")
    }
    
  2. Set Always Embed Swift Standard Libraries to Yes in your project configuration.

6. Create the SDK configuration

Once you have an added the SDK as a dependency, and you have an applicant ID, you can configure the SDK:

Swift

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN>")
    .withWelcomeStep()
    .withDocumentStep()
    .withProofOfAddressStep()
    .withFaceStep(ofVariant: .photo(withConfiguration: nil))
    .build()

let onfidoFlow = OnfidoFlow(withConfiguration: config)
    .with(responseHandler: { results in
        // Callback when flow ends
    })

Objective-C

Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];

[configBuilder withSdkToken:@"YOUR_SDK_TOKEN"];
[configBuilder withWelcomeStep];
[configBuilder withDocumentStep];
[configBuilder withProofOfAddressStep];

NSError *variantConfigError = NULL;
Builder *variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withPhotoCaptureWithConfig: NULL];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &variantConfigError]];

if (variantConfigError == NULL) {
  NSError *configError = NULL;
  ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];

  if (configError == NULL) {
      ONFlow *onFlow = [[ONFlow alloc] initWithFlowConfiguration:config];
      [onFlow withResponseHandler:^(ONFlowResponse *response) {
          // Callback when flow ends
      }];
  }
}

7. Start the flow

Swift

swift
Copy
try onfidoRun.run(from: yourViewController, animated: true)

Objective-C

Objective-C
Copy
NSError *runError = NULL;
[onFlow runFrom:yourViewController animated:YES error:&runError completion:nil];

if (runError != NULL) {
    // do fallback logic
}

Handling callbacks

Swift

To receive the result from the flow, you should pass a callback to the instance of OnfidoFlow.

The result object passed to the callback may include the following attributes:

swift
Copy
let responseHandler: (OnfidoResponse) -> Void = { response in
    switch response {
    case .error(let error):
    case .success(let results):
    case .cancel(let reason):
    }
}
AttributeNotes
.success([OnfidoResult])User completed the flow. You can now create a check on your backend server.
.error(Error)Some error happened.
.cancelFlow was cancelled by the user. The reason can be .userExit (when the user taps back button on the first screen) or .deniedConsent (when the user denies consent on the consent screen) or .requiredNFCFlowNotCompleted (when the NFC step is required and the user did not complete it)

Objective-C

To receive the result from the flow, you should pass a callback to the instance of ONFlow.

An instance of ONFlowResponse is passed back to the callback with 3 properties:

Objective-C
Copy
(^responseHandlerBlock)(ONFlowResponse *response) {
    if (response.userCanceled) {
    } else if (response.results) {
    } else if (response.error) {
    }
}
PropertiesNotes
resultsUser completed the flow. You can now create a check on your backend server.
errorSome error happened.
userCanceledFlow was cancelled by the user. You can check why the user cancelled using response.userCanceled.reason. When userCanceled is false then results or error properties will be set.

Success handling

Success is when the user has reached the end of the flow.

Swift

[OnfidoResult] is a list with multiple results. The results are different enum values, each with its own associated value (also known as payload). This enum, OnfidoResult, can have the following values:

  1. OnfidoResult.document and OnfidoResult.face: Its payload is relevant in case you want to manipulate or preview the captures in some way.
Capture result payload

You shouldn't need to inspect the results of the document and face captures as the SDK handles file uploads. However, if you want to see further information, you can access the result object.

Example for a document capture:

swift
Copy
let document: Optional<OnfidoResult> = results.first { result in
    if case OnfidoResult.document = result { return true }
    return false
}

if let document,
   case OnfidoResult.document(let documentResult) = document {
    print(document.front.id)
}

To access the result object for a face capture input the case as OnfidoResult.face.

Objective-C

[ONFlowResult] is a list with multiple results. The result is an instance of ONFlowResult containing 2 properties:

  • type, which is an enum with values ONFlowResultTypeDocument, ONFlowResultTypeFace
  • result, which instance type can be of ONDocumentResult or ONFaceResult. The result type can be derived by the type property
Capture result payload

You shouldn't need to inspect the results of the document and face captures as the SDK handles file uploads.However, if you want to see further information, you can access the result object.

Example for a document capture:

Objective-C
Copy
NSPredicate *documentResultPredicate = [NSPredicate predicateWithBlock:^BOOL(id flowResult, NSDictionary *bindings) {
    if (((ONFlowResult *)flowResult).type == ONFlowResultTypeDocument) {
        return YES;
    } else {
        return NO;
    }
}];
NSArray *flowWithDocumentResults = [results filteredArrayUsingPredicate:documentResultPredicate];

if (flowWithDocumentResults.count > 0) {
    ONDocumentResult *documentResult = ((ONFlowResult *)flowWithDocumentResults[0]).result;
    NSLog(@"%@", documentResult.front.id);
}

To access the result object for a face capture change the type to ONFlowResultTypeFace.

Error handling

Swift

Response Handler Errors

The Error object returned as part of OnfidoResponse.error(Error) is of type OnfidoFlowError. It's an enum with multiple cases depending on the error type.

swift
Copy
switch response {
case let OnfidoResponse.error(error):
    switch error {
    case OnfidoFlowError.cameraPermission:
        // It happens if the user denies permission to the sdk during the flow
    case OnfidoFlowError.microphonePermission:
        // It happens when the user denies permission for microphone usage by the app during the flow
    case OnfidoFlowError.motionUnsupported:
        // It happens when the device does not support the Motion product and no fallback capture method has been configured
    case OnfidoFlowError.failedToWriteToDisk:
        // It happens when the SDK tries to save capture to disk, maybe due to a lack of space
    case OnfidoFlowError.upload(let OnfidoApiError):
        // It happens when the SDK receives an error from a API call see [https://documentation.onfido.com/#errors](https://documentation.onfido.com/#errors) for more information
    case OnfidoFlowError.exception(withError: let error, withMessage: let message):
        // It happens when an unexpected error occurs, please contact [ios-sdk@onfido.com](mailto:ios-sdk@onfido.com?Subject=ISSUE%3A) when this happens
    case OnfidoFlowError.invalidImageData:
        // It happens when the SDK tries to save capture to disk, but the image failed to compress to JPEG data
    case OnfidoFlowError.versionInsufficient:
        // It happens when the workflow version is insufficient
    default: // necessary because swift
    }
}

Note: Not all errors will be passed to OnfidoResponse.error. Run Exceptions and Configuration errors will be returned as an exception.

Run exceptions

When initiating the SDK there can be an exception.

You can handle run exceptions in Swift with a do/catch as shown below:

swift
Copy
do {
    try onfidoFlow.run(from: yourViewController, animated: true)
} catch let error {
    switch error {
    case OnfidoFlowError.cameraPermission:
        // do something about it here
    case OnfidoFlowError.microphonePermission:
        // do something about it here
    default:
        // should not happen, so if it does, log it and let us know
    }
}
Configuration errors

You must provide the following when configuring the Onfido iOS SDK:

  • SDK token
  • applicant
  • at least one capture step

Otherwise, you may encounter the following errors when calling the build() function on the OnfidoConfig.Builder instance:

ErrorNotes
OnfidoConfigError.missingSDKTokenWhen no token is provided or the token is an empty string.
OnfidoConfigError.invalidSDKTokenWhen an invalid token is provided.
OnfidoConfigError.missingStepsWhen no step is provided.
OnfidoConfigError.invalidDocumentFormatAndCountryCombinationWhen it is an unsupported document format for the specified country provided. See Document Type Configuration to check supported combinations.
OnfidoConfigError.invalidCountryCodeWhen an invalid country code is provided.

Objective-C

Response Handler Errors

The error property of the ONFlowResponse is of type NSError.

You can identify the error by comparing the code property of the NSError instance with ONFlowError, i.e. response.code == ONFlowErrorCameraPermission. You can also print or log the userInfo property of the NSError instance.

The NSError contained within the ONFlowResponse's error property can be handled as follows:

Objective-C
Copy
switch (error.code) {
case ONFlowErrorCameraPermission:
    // It happens if the user denies permission to the sdk during the flow
    break;
case ONFlowErrorMicrophonePermission:
    // It happens when the user denies permission for microphone usage by the app during the flow
    break;
case ONFlowErrorMotionUnsupported:
    // It happens when the device does not support the Motion product and no fallback capture method has been configured
    break;
case ONFlowErrorFailedToWriteToDisk:
    // It happens when the SDK tries to save capture to disk, maybe due to a lack of space
    break;
case ONFlowErrorUpload:
    // It happens when the SDK receives an error from a API call see  [https://documentation.onfido.com/#errors](https://documentation.onfido.com/#errors) for more information
    // you can find out more by printing or logging userInfo from error
    break;
case ONFlowErrorException:
    // It happens when an unexpected error occurs, please contact [ios-sdk@onfido.com](mailto:ios-sdk@onfido.com?Subject=ISSUE%3A) when this happens
    break;
case ONFlowErrorInvalidImageData:
    // It happens when the SDK tries to save capture to disk, but the image failed to compress to JPEG data
    break;
case ONFlowErrorVersionInsufficient:
    // It happens when the workflow version is insufficient
    break;
}

Note: Not all errors which are part of ONFlowError will be passed to the response handler block. Run Exceptions and Configuration errors will be returned as an exception.

Run exceptions

You can handle run exceptions as shown below:

Objective-C
Copy
NSError *runError = NULL;
 [onFlow runFrom:yourViewController animated:YES error:&runError completion:nil]; //`yourViewController` should be your view controller

if (runError) {
    switch (runError.code) {
        case ONFlowErrorCameraPermission:
            // do something about it here
            break;
        case ONFlowErrorMicrophonePermission:
            // do something about it here
            break;
        default:
            // do something about it here
            break;
    }
}
Configuration errors

You must provide the following when configuring the Onfido iOS SDK:

  • SDK token
  • applicant
  • at least one capture step

Otherwise you may encounter the following errors when calling the build() function on the ONFlowConfigBuilder:

ErrorNotes
ONFlowConfigErrorMissingTokenWhen no token is provided or the token is an empty string.
ONFlowConfigErrorMissingApplicantWhen no applicant instance is provided.
ONFlowConfigErrorMissingStepsWhen no step is provided.
ONFlowConfigErrorMultipleTokenTypesWhen both an SDK token and a Mobile token are provided.
ONFlowConfigErrorApplicantProvidedWithSDKTokenWhen both an SDK token and an applicant are provided.
ONFlowConfigErrorInvalidDocumentFormatAndCountryCombinationWhen it is an unsupported document format for the specified country provided. See Document Type Configuration to check supported combinations.
ONFlowConfigErrorInvalidCountryCodeWhen an invalid country code is provided.

Custom Callbacks

Media Callbacks

Introduction

Onfido provides the possibility to integrate with our Smart Capture SDK, without the requirement of using this data only through the Onfido API. Media callbacks enable you to control the end user data collected by the SDK after the end user has submitted their captured media. As a result, you can leverage Onfido’s advanced on-device technology, including image quality validations, while still being able to handle end users’ data directly. This unlocks additional use cases, including compliance requirements and multi-vendor configurations, that require this additional flexibility.

This feature must be enabled for your account. Please contact your Onfido Solution Engineer or Customer Success Manager.

Implementation

To use this feature, use .withMediaCallback and provide the callbacks for MediaDocumentResult for documents and MediaFile for live photos and live videos.

Swift
swift
Copy
final class SwiftDynamicFrameworkOnfidoRunner: OnfidoRunner, MediaCallback {
    func onMediaCaptured(result: MediaResult) {
        switch result {
        case let documentResult as MediaDocumentResult:
            // Your callback code here
        case let selfieResult as SelfieResult:
            // Your callback code here
        case let livenessResult as LivenessResult:
            // Your callback code here
        default:
            break
        }
    }

    init() {
        ...
        configBuilder.withMediaCallback(mediaCallback: self)
    }
}    

User data

The callbacks return an object including the information that the SDK normally sends directly to Onfido. The callbacks are invoked when the end user confirms submission of their image through the SDK’s user interface.

Note: Currently, end user data will still automatically be sent to the Onfido backend, but you are not required to use Onfido to process this data.

The callback returns 3 possible objects:

  1. For documents, the callback returns a MediaDocumentResult object:
swift
Copy
class MediaDocumentResult {
    let metadata: DocumentMetadata
    let file: MediaFile
}

The DocumentMetadata object contains the metadata of the captured document:

swift
Copy
class DocumentMetadata {
    let side: String
    let type: String
    let issuingCountry: String?
}

Note: issuingCountry is optional based on end-user selection, and can be null. Note: If a document was scanned using NFC, the callback will return the passport photo in file but no additional data.

  1. For live photos, the callback returns a SelfieResult object:
swift
Copy
class SelfieResult {
    let fileData: MediaFile
}
  1. For videos, the callback returns a LivenessResult object:
swift
Copy
class LivenessResult {
    let fileData: MediaFile
}

And the MediaFile object has:

swift
Copy
class MediaFile {
    let fileData: Data
    let fileName: String
    let fileType: String
}

Create a check with Onfido

After receiving the user data from the SDK, you can choose to create a check with Onfido. In this case, you don’t need to re-upload the end user data as it is sent automatically from the SDK to the Onfido backend.

Please see our API documentation for more information on how to create a check.

Customizing SDK

The iOS SDK has multiple customizable options. You can also read our SDK customization guide.

Flow customization

Welcome step

This step is the introduction screen of the SDK. It displays a summary of the capture steps the user will pass through. This is an optional screen.

You can show the welcome screen by calling configBuilder.withWelcomeStep() in Swift or [configBuilder withWelcomeStep] in Objective-C.

Swift
swift
Copy
let config = try OnfidoConfig.builder()
    .withWelcomeStep()
    ...
    .build()
Objective-C
Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];
...
[configBuilder withWelcomeStep];

NSError *configError = NULL;
ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];

if (configError) {
    // Handle config build error
} else {
    // use config
}

This step contains a screen to collect US end users' privacy consent for Onfido. It contains the consent language required when you offer your service to US users as well as links to Onfido's policies and terms of use. This is an optional screen.

The user must click "Accept" to move past this step and continue with the flow. The content is available in English only, and is not translatable.

This step doesn't automatically inform Onfido that the user has given their consent. At the end of the SDK flow, you still need to set the API parameter privacy_notices_read_consent_given outside of the SDK flow when creating a check.

If you choose to disable this step, you must incorporate the required consent language and links to Onfido's policies and terms of use into your own application's flow before your end user starts interacting with the Onfido SDK.

For more information about this step, and how to collect user consent, please visit Onfido Privacy Notices and Consent.

Document step

In the Document Capture step, an end user can select the issuing country and document type before capture. In a very limited number of cases, the end user may also be asked if they have a card or paper version of their document.

This information is used to optimize the capture experience, as well as inform the end user about which documents they are allowed to use.

This selection screen is optional, and will be automatically hidden where the end user is not required to indicate which document will be captured.

By default, the country selection will be pre-populated based on the end user’s primary SIM, but the end user can select another country from the list where allowed. The selection will default to empty when no SIM is present.

The default country selection The default country selection

You can specify allowed issuing countries and document types for the document capture step in one of three ways:

  • If you are using Onfido Studio, this is configured within a Document Capture task, documented in the Studio Product Guide
  • Otherwise, for Onfido Classic you can set this globally in your Dashboard (recommended), or hard code it into your SDK integration. Both of these options are documented below.
Country and document type selection by Dashboard

Configuring the issuing country and document type selection step using your Dashboard is the recommended method of customization (available from iOS SDK version 28.0.0 and Android SDK version 16.0.0 onwards) as this configuration is also applied to your Document Reports. Any document that has been uploaded by an end user against your guidance will result in a Document Report sub-result of “rejected” and be flagged as Image Integrity > Supported Document.

We will be rolling out Dashboard-based configuration of allowed documents soon. In the meantime, contact support@onfido.com or your Customer Support Manager to request access to this feature.

  • Open the Accounts tab on your Dashboard then click Supported Documents
  • You will be presented with a list of all available countries and their associated supported documents. Make your selection, then click Save Change

The Supported Documents tab in the Dashboard

Please note the following SDK behaviour:

  • Hard coding any document type and issuing country configuration in your SDK integration will fully override the Dashboard-based settings
  • Currently, only passport, national ID card, driving licence and residence permit are visible for document selection by the end user in the SDK. If you nominate other document types in your Dashboard (visa, for example), these will not be displayed in the user interface
  • If you need to add other document types to the document selection screen, you can mitigate this limitation in the near-term, using the Custom Document feature
  • If for any reason the configuration fails or is not enabled, the SDK will fallback to display the selection screen for the complete list of documents supported within the selection screens
Country and document type selection - SDK integration code

If you want to use your own custom document selection UI instead of displaying the Onfido document selection screen, you will need to specify the document details during SDK initialization.

The document selection screen will be skipped automatically when the single document type is specified.

The SDK will accept the following:

  • The Document Type is required. This controls fundamental SDK document capture behaviour
  • The Country is optional, but recommended. This enables any optimizations the SDK may have for this specific document issued by this country
  • The Document Format is optional, and only accepted for French driving licence, Italian national identity card and South African national identity card This defaults to Card, representing modern forms of these documents. If the end user indicates that they have an older, paper version of one of these documents, use Folded to ensure an optimized capture experience

See more details in the Technical Reference, here for Android, and here for iOS.

Note: You may still wish to configure the Dashboard-based approach to ensure that the Document Report also rejects any document that has been uploaded by an end user against your guidance.

  • Document type

The list of document types visible for the user to select can be shown or hidden using this option. Each document type has its own configuration class. While configuring document type, you can optionally pass a configuration object along with the document type.

The following document types are supported:

Document TypeConfiguration ClassConfigurable Properties
passportPassportConfiguration- country
drivingLicenceDrivingLicenceConfiguration- country
- documentFormat
nationalIdentityCardNationalIdentityConfiguration- country
- documentFormat
residencePermitResidencePermitConfiguration- country
visaVisaConfiguration- country
workPermitWorkPermitConfiguration- country

Note: If only one document type is specified, users will not see the selection screen and will be taken directly to the capture screen. Please see a more detailed guide here for Android, and here for iOS

  • Document country

Country configuration allows you to specify the country of origin of the document. This is optional, but recommended. This enables any optimizations the SDK may have for this specific document issued by this country.

You'll need to pass the corresponding ISO 3166-1 alpha-3 3 letter country code to the SDK.

Note: You can specify country for all document types except passport. This is because passports have the same format worldwide so the SDK does not require this additional information.

Note:: The SDK will throw a OnfidoConfigError.invalidCountryCode (ONFlowConfigErrorInvalidCountryCode) error if an invalid country code is provided.

For example, to only capture UK driving licenses:

Swift
swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withDocumentStep(ofType: .drivingLicence(config: DrivingLicenceConfiguration(country: "GBR")))
    .build()
Objective-C
Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

NSError *documentConfigError = NULL;
DocumentConfigBuilder *documentConfigBuilder = [ONDocumentTypeConfig builder];
[documentConfigBuilder withDrivingLicenceWithConfig:[[DrivingLicenceConfiguration alloc] initWithCountry: @"GBR"]];
ONDocumentTypeConfig *documentTypeConfig = [documentConfigBuilder buildAndReturnError: documentConfigError];

if (documentConfigError) {
  // Handle variant config error
} else {
  NSError *configError = NULL;
  [configBuilder withDocumentStepOfType:documentTypeConfig];
  ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];
}
  • Document format

The Document Format is optional, and only accepted for French driving licence, Italian national identity card and South African national identity card This defaults to Card, representing modern forms of these documents. If the end user indicates that they have an older, paper version of one of these documents, use Folded to ensure an optimized capture experience

If Folded is configured the SDK will show a specific template overlay during document capture.

The following document formats are supported for each document type:

Document Type/ Document Formatcardfolded
drivingLicenceALL COUNTRIESOnly France (Country code "FRA")
nationalIdentityCardALL COUNTRIESItaly (Country code "ITA")
South Africa (Country code "ZAF")
Document Type/ Document Format
passportNOT CONFIGURABLE
residencePermitNOT CONFIGURABLE
visaNOT CONFIGURABLE
workPermitNOT CONFIGURABLE

Note: If you configure the SDK with an unsupported document format the SDK will throw an OnfidoConfigError.invalidDocumentFormatAndCountryCombination (ONFlowConfigErrorInvalidDocumentFormatAndCountryCombination in Objective-C) error during runtime.

For example, for a folded Italian national identity card:

Swift
swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("YOUR_SDK_TOKEN_HERE")
    .withDocumentStep(ofType: .nationalIdentityCard(config: NationalIdentityConfiguration(documentFormat: .folded, country: "ITA")))
    .build()
Objective-C
Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

NSError *documentConfigError = NULL;
DocumentConfigBuilder *documentConfigBuilder = [ONDocumentTypeConfig builder];
[documentConfigBuilder withNationalIdentityCardWithConfig:[[NationalIdentityConfiguration alloc] initWithDocumentFormat:DocumentFormatFolded country: @"ITA"]];
ONDocumentTypeConfig *documentTypeConfig = [documentConfigBuilder buildAndReturnError: documentConfigError];

if (documentConfigError) {
  // Handle variant config error
} else {
  NSError *configError = NULL;
  [configBuilder withDocumentStepOfType:documentTypeConfig];
  ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];
}
  • Customize the issuing country and document type selection screen with pre-selected documents

You can also customize the screen to display only a limited list of document types, using the configuration function to specify the ones you want to show.

Currently you can only include passport, identityCard, drivingLicence, residencePermit in the list.

For example, to show only the passport and drivingLicence document types:

Swift

swift
Copy
let config = try OnfidoConfig.builder()
    .withDocumentStep(ofSelectableTypes: [.passport, .drivingLicence])

Objective-C

Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withDocumentStepWithSelectableDocumentTypes: @[@(SelectableDocumentTypePassport), @(SelectableDocumentTypeDrivingLicence)]];

Face step

In the Face step, a user can use the front camera to capture a live photo of their face (Photo), a live video (Video) or a motion capture using the Motion product (Motion).

The Face step has 3 variants for the Swift interface:

  • FaceStepVariant.photo(with: PhotoStepConfiguration?)
  • FaceStepVariant.video(with: VideoStepConfiguration?)
  • FaceStepVariant.motion(with: MotionStepConfiguration?)

For the Objective-C interface, you should use ONFaceStepVariantConfig as below.

To configure for a live photo:

Copy
NSError * error;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withPhotoCaptureWithConfig: [[PhotoStepConfiguration alloc] initWithShowSelfieIntroScreen: YES]]];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];

To configure for a live video:

Copy
NSError * error;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withVideoCaptureWithConfig:
   [[VideoStepConfiguration alloc] initWithShowIntroVideo: YES manualLivenessCapture: NO]];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];

To configure for Motion:

The Motion variant may not be supported on certain devices based on minimum device and OS requirements, i.e. Motion currently is not supported on devices older than iPhone 7 and/or on iOS older than 12 as well as on iPads.

If the Motion variant is not supported on the user's device, you can configure the SDK to allow the user to capture a Selfie or a Video instead by using the MotionStepCaptureFallback class.

The following examples show how to configure the Motion variant with a Photo capture fallback and a Video capture fallback.

Please note that if no fallback is configured and Motion is not supported on the user's device, an ONFlowError of case motionUnsupported will be returned through the response handler.

To configure for Motion with fallback to capturing a live photo:

Copy
NSError * error;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withMotionWithConfig:
    [[MotionStepConfiguration alloc] initWithCaptureFallback:
        [[MotionStepCaptureFallback alloc] initWithPhotoFallbackWithConfiguration:
            [[PhotoStepConfiguration alloc] initWithShowSelfieIntroScreen: YES]]]];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];

To configure for Motion with fallback to capturing a live video:

Copy
NSError * error;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withMotionWithConfig:
    [[MotionStepConfiguration alloc] initWithCaptureFallback:
        [[MotionStepCaptureFallback alloc] initWithVideoFallbackWithConfiguration:
            [[VideoStepConfiguration alloc] initWithShowIntroVideo: YES manualLivenessCapture: NO]]]];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];

To configure for Motion with no fallback:

Copy
NSError * error;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withMotionWithConfig: NULL];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];

To configure for Motion with audio recording:

Copy
NSError * error;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withMotionWithConfig: [[MotionStepConfiguration alloc] initWithRecordAudio: YES]];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];
Swift

To configure for a live photo:

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep()
    .withFaceStep(ofVariant: .photo(withConfiguration: PhotoStepConfiguration(showSelfieIntroScreen: true)))
    .build()

To configure for a live video:

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep()
    .withFaceStep(ofVariant: .video(withConfiguration: VideoStepConfiguration(showIntroVideo: true, manualLivenessCapture: false)))
    .build()

To configure for Motion:

The Motion variant may not be supported on certain devices based on minimum device and OS requirements, i.e. Motion currently is not supported on devices older than iPhone 7 and/or on iOS older than 12 as well as on iPads.

If the Motion variant is not supported on the user's device, you can configure the SDK to allow the user to capture a Selfie or a Video instead by using the MotionStepCaptureFallback class.

The following examples show how to configure the Motion variant with a Photo capture fallback and a Video capture fallback.

Please note that if no fallback is configured and Motion is not supported on the user's device, an ONFlowError of case motionUnsupported will be returned through the response handler.

To configure for Motion with fallback to capturing a live photo:

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep()
    .withFaceStep(ofVariant: .motion(withConfiguration:
        MotionStepConfiguration(captureFallback:
            MotionStepCaptureFallback(photoFallbackWithConfiguration:
                PhotoStepConfiguration(showSelfieIntroScreen: true)))))
    .build()

To configure for Motion with fallback to capturing a live video:

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep()
    .withFaceStep(ofVariant: .motion(withConfiguration:
        MotionStepConfiguration(captureFallback:
            MotionStepCaptureFallback(videoFallbackWithConfiguration:
                VideoStepConfiguration(showIntroVideo: true, manualLivenessCapture: false)))))
    .build()

To configure for Motion with no fallback:

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep()
    .withFaceStep(ofVariant: .motion(withConfiguration: nil))
    .build()

To configure for Motion with audio recording:

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep()
    .withFaceStep(ofVariant: .motion(withConfiguration: MotionStepConfiguration(recordAudio: true)))
    .build()
Objective-C
Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];

[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];
[configBuilder withWelcomeStep];
[configBuilder withDocumentStep];
NSError *variantError = NULL;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withVideoCaptureWithConfig: [[VideoStepConfiguration alloc] initWithShowIntroVideo: YES]];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &variantError]];

if (variantError) {
  // Handle variant config error
} else {
  NSError *configError = NULL;
  ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];

  if (configError) {
      // Handle config build error
  } else {
      // use config
  }
}

Proof of Address step

In the Proof of Address step, a user picks the issuing country and type of document that proves their address before capturing the document with their phone camera or uploading it.

Swift
swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withProofOfAddressStep()
    .build()
Objective-C
Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];
[configBuilder withProofOfAddressStep];

NSError *configError = NULL;
ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];

if (configError) {
    // Handle config build error
} else {
    // use config
}

NFC capture

Recent passports, national identity cards and residence permits contain a chip that can be accessed using Near Field Communication (NFC). The Onfido SDKs provide a set of screens and functionalities to extract this information, verify its authenticity and provide the results as part of a Document report. With version [29.1.0] of the Onfido iOS SDK, NFC is enabled by default and offered to customer when both the document and the device support NFC.

For more information on how to configure NFC and the list of supported documents, please refer to the NFC for Document Report guide.

Pre-requisites

  • This feature requires Near Field Communication Tag Reading capability in your app target. If you haven't added it before, please follow the steps in Apple's documentation.

  • You're required to have the following key in your application's Info.plist file:

xml
Copy
<key>NFCReaderUsageDescription</key>
<string>Required to read ePassports</string>
  • You have to include the entries below in your app target's Info.plist file to be able to read NFC tags properly.
Copy
<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
  <string>12FC</string>
</array>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
  <string>A0000002471001</string>
  <string>A0000002472001</string>
  <string>00000000000000</string>
  <string>D2760000850101</string>
</array>

UI customization

The iOS SDK supports the customization of colors, fonts and strings used in the SDK flow. For visualizations of the available options please see our SDK customization guide.

Swift

swift
Copy
let appearance = Appearance()
appearance.primaryColor = <DESIRED_UI_COLOR_HERE>
appearance.primaryTitleColor = <DESIRED_UI_COLOR_HERE>
appearance.secondaryTitleColor = <DESIRED_UI_COLOR_HERE>
appearance.primaryBackgroundPressedColor = <DESIRED_UI_COLOR_HERE>
appearance.secondaryBackgroundPressedColor = <DESIRED_UI_COLOR_HERE>
appearance.backgroundColor = <DESIRED_UI_COLOR_HERE>
appearance.borderCornerRadius = <DESIRED_CGFLOAT_BORDER_RADIUS_HERE>
appearance.fontRegular = <DESIRED_FONT_NAME_HERE>
appearance.fontBold = <DESIRED_FONT_NAME_HERE>
appearance.setUserInterfaceStyle(<.unspecified | .light | .dark>)
appearance.captureSuccessColors = <CaptureSuccessColors object>

Objective-C

Objective-C
Copy
ONAppearance *appearance = [[ONAppearance alloc] init];
appearance.primaryColor = <DESIRED_UI_COLOR_HERE>;
appearance.primaryTitleColor = <DESIRED_UI_COLOR_HERE>;
appearance.secondaryTitleColor = <DESIRED_UI_COLOR_HERE>;
appearance.primaryBackgroundPressedColor = <DESIRED_UI_COLOR_HERE>;
appearance.secondaryBackgroundPressedColor = <DESIRED_UI_COLOR_HERE>;
appearance.backgroundColor = <DESIRED_UI_COLOR_HERE>;
appearance.buttonCornerRadius = <DESIRED_CGFLOAT_BORDER_RADIUS_HERE>;
appearance.fontRegular = <DESIRED_FONT_NAME_HERE>;
appearance.fontBold = <DESIRED_FONT_NAME_HERE>;
[appearance setUserInterfaceStyle: <UIUserInterfaceStyleUnspecified | UIUserInterfaceStyleLight | UIUserInterfaceStyleDark>];
appearance.captureSuccessColors = <CaptureSuccessColors object>;
  • primaryColor: Defines the button color and back navigation button color
  • primaryTitleColor: Defines the primary button text color
  • secondaryTitleColor: Defines the secondary button text and border color
  • primaryBackgroundPressedColor: Defines the primary button pressed state color
  • secondaryBackgroundPressedColor: Defines the secondary button pressed state color
  • backgroundColor: Defines the screen's background color
  • borderCornerRadius: Defined border corner radius for all the buttons (default 5.0)
  • fontRegular: Defines the custom font name for the regular style labels
  • fontBold: Defines the custom font name for the bold style labels
  • interfaceStyle: Defines the interface style Note: This property is applicable only for Xcode 11 and above built apps and devices running on iOS 13 and above
  • captureSuccessColors: Defines the color values for the capture screen success auto capture state
    • borderColor: Defines the border color of the area of interest in capture screen
    • tickViewImageTintColor: Defines the tick icon's tint color shown in capture screen after auto capture happens
    • tickViewBackgroundColor: Defines the tick icon's background color shown in capture screen after auto capture happens

Dark Mode Customization

interfaceStyle allows you to force light or dark mode via .dark and .light respectively. By default, it is set to .unspecified, which will follow the system's interface style.

Note: The previous attribute supportDarkMode is now deprecated. Please use interfaceStyle instead.

For example, to set the interface style to .dark, you can use the code below:

Swift
swift
Copy
let appearance = Appearance()
appearance.setUserInterfaceStyle(.dark)
Objective-C
Objective-C
Copy
ONAppearance *appearance = [ONAppearance new];
[appearance setUserInterfaceStyle:UIUserInterfaceStyleDark];

Applying the Appearance object

To apply the appearance you can use the methods below:

Swift
swift
Copy
let configBuilder = OnfidoConfig.builder()
configBuilder.withAppearance(appearance)
Objective-C
Objective-C
Copy
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withAppearance:appearance];

Language customization

The SDK supports and maintains the following 44 languages:

  • Arabic: ar
  • Armenian: hy
  • Bulgarian: bg
  • Chinese (Simplified): zh-Hans
  • Chinese (Traditional): zh-Hant
  • Croatian: hr
  • Czech: cs
  • Danish: da
  • Dutch: nl
  • English (United Kingdom): en-GB
  • English: en
  • Estonian: et
  • Finnish: fi
  • French (Canadian): fr-CA
  • French: fr
  • German: de
  • Greek: el
  • Hebrew: he
  • Hindi: hi
  • Hungarian: hu
  • Indonesian: id
  • Italian: it
  • Japanese: ja
  • Korean: ko
  • Latvian: lv
  • Lithuanian: lt
  • Malay: ms
  • Norwegian (Bokmål): no
  • Persian: fa
  • Polish: pl
  • Portuguese (Brazil): pt-BR
  • Portuguese: pt
  • Romanian: ro
  • Russian: ru
  • Serbian (Latin): sr-Latn
  • Slovak: sk
  • Slovenian: sl
  • Spanish (Latin America): es-419
  • Spanish: es
  • Swedish: sv
  • Thai: th
  • Turkish: tr
  • Ukrainian: uk
  • Vietnamese: vi

The strings used within the SDK can be customised by having a Localizable.strings in your app for the desired language and by configuring the flow using withCustomLocalization() method on the configuration builder.

You can find the keys for the localizable strings under the localization directory which contains strings files for supported languages.

Swift

swift
Copy
let config = try OnfidoConfig.builder()
    .withSDKToken("<YOUR_SDK_TOKEN_HERE>")
    .withWelcomeStep()
    .withDocumentStep(ofType: .drivingLicence(config: DrivingLicenceConfiguration(country: "GBR")))
    .withFaceStep(ofVariant: .photo(withConfiguration: nil))
    .withCustomLocalization() // will look for localizable strings in your Localizable.strings file
    .build()

Objective-C

Objective-C
Copy
ONFlowConfigBuilder *configBuilder =  [ONFlowConfig builder];

[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];
[configBuilder withWelcomeStep];
[configBuilder withDocumentStepOfType:ONDocumentTypeDrivingLicence andCountryCode:@"GBR"];
NSError *variantError = NULL;
Builder * variantBuilder = [ONFaceStepVariantConfig builder];
[variantBuilder withPhotoCaptureWithConfig: NULL];
[configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &variantError]];

if (variantError) {
  // Handle variant config error
} else {
  [configBuilder withCustomLocalization]; // will look for localizable strings in your Localizable.strings file
  NSError *configError = NULL;
  ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];
}

Custom languages

The SDK can also be displayed in a custom language for locales that Onfido does not currently support. You can supply full or partial translations. For any key without a translation, the supported language default will be used.

When adding custom translations, you must add the whole set of keys included in the Localizable.strings file.

You can name the strings file with the translated keys as you desire but the name of the file will have to be provided to the SDK as a parameter to the withCustomLocalization() method:

withCustomLocalization(andTableName: "MY_CUSTOM_STRINGS_FILE") (swift) or [configBuilder withCustomLocalizationWithTableName:@"MY_CUSTOM_STRINGS_FILE"]; (Objective-C).

Additionally you can specify the bundle from which to read the strings file:

withCustomLocalization(andTableName: "MY_CUSTOM_STRINGS_FILE", in: myBundle) (swift) or [configBuilder withCustomLocalizationWithTableName:@"MY_CUSTOM_STRINGS_FILE" in: myBundle]; (Objective-C).

Note: If string translations change it will result in a MINOR version change. If you have custom translations you're responsible for testing your translated layout.

If you want a language translated you can get in touch with us at ios-sdk@onfido.com

Generating verification reports

While the SDK is responsible for capturing and uploading document photos, live selfies, live videos and motion captures, identity verification reports themselves are generated based on workflows created using Onfido Studio.

For a step-by-step walkthrough of creating an identity verification using Onfido Studio and our SDKs, please refer to our Quick Start Guide.

Alternatively, you can create checks and retrieve report results manually using the Onfido API. You can also configure webhooks to be notified asynchronously of report results.

Note: If you're using API v2 for API calls, please refer to the API v2 to v3 migration guide for more information.

Note: If you're testing with a sandbox token, please be aware that report results are pre-determined. You can learn more about sandbox responses here.

Setting up webhooks

Reports may not return results straightaway. You can set up webhooks to be notified upon completion of a check or report, or both.

User Analytics

The SDK allows you to track a user's journey through the verification process via a definable hook. This gives insight into how your users make use of the SDK screens.

Overriding the hook

In order to expose a user's progress through the SDK a hook method must be defined while creating the OnfidoFlow.swift instance using a .with(eventHandler: EventHandler) call. For example:

swift
Copy
OnfidoFlow(withConfiguration: config)
    .with(eventHandler: {
        (event: Event) -> () in
        // Your code here
    })

The code inside of the defined method will now be called when a particular event is triggered, usually when the user reaches a new screen. For a full list of events see tracked events.

The parameter being passed in is an OnfidoFlow.Event struct which contains the following:

eventNamestring < /br> Indicates the type of event. This will always be returned as "Screen" as each tracked event is a user visiting a screen.
propertiesdictionary < /br> Contains the specific details of an event. For example, the name of the screen visited.

Using the data

You can use the data to keep track of how many users reach each screen in your flow. You can do this by storing the number of users that reach each screen and comparing that to the number of users who reached the Welcome screen.

Tracked events

Below is the list of potential events currently being tracked by the hook:

Copy
WELCOME - User reached the "Welcome" screen
USER_CONSENT - User reached "user consent" screen
DOCUMENT_CAPTURE - User reached the "document capture" screen (for one-sided document)
DOCUMENT_CAPTURE_FRONT - User reached the "document capture" screen for the front side (for two-sided document)
DOCUMENT_CAPTURE_BACK - User reached the "document capture" screen for the back side (for two-sided document)
DOCUMENT_CAPTURE_CONFIRMATION - User reached the "document confirmation" screen (for one-sided document)
DOCUMENT_CAPTURE_CONFIRMATION_FRONT - User reached the "document confirmation" screen for the front side (for two-sided document)
DOCUMENT_CAPTURE_CONFIRMATION_BACK - User reached the "document confirmation" screen for the back side (for two-sided document)
DOCUMENT_UPLOAD - User's document is uploading
FACIAL_INTRO - User reached the "selfie intro" screen
FACIAL_CAPTURE - User reached the "selfie capture" screen
FACIAL_CAPTURE_CONFIRMATION - User reached the "selfie confirmation" screen
FACIAL_UPLOAD - User's selfie is uploading
VIDEO_FACIAL_INTRO - User reached the "liveness intro" screen
VIDEO_FACIAL_CAPTURE - User reached the "liveness video capture" screen
VIDEO_FACIAL_CAPTURE_STEP_1 - User reached the 1st challenge during "liveness video capture", challenge_type can be found in eventProperties
VIDEO_FACIAL_CAPTURE_STEP_2 - User reached the 1st challenge during "liveness video capture", challenge_type can be found in eventProperties
VIDEO_FACIAL_CAPTURE_CONFIRMATION - User reached the "liveness video confirmation" screen
VIDEO_FACIAL_UPLOAD - User's liveness video is uploading
MOTION_FACIAL_INTRO - User reached the "motion intro" screen
MOTION_FACIAL_ALIGNMENT - User reached the "motion alignment" screen
MOTION_FACIAL_CAPTURE - User reached the "motion capture" screen
MOTION_FACIAL_NO_FACE_DETECTED - User's face was not detected
MOTION_FACIAL_CAPTURE_ERROR_TIMEOUT - User's motion capture timed out
MOTION_FACIAL_CAPTURE_ERROR_TOO_FAST - User performed the motion headturn too fast
MOTION_FACIAL_UPLOAD - User's motion capture is uploading
MOTION_FACIAL_UPLOAD_COMPLETED - User's motion capture finished uploading
MOTION_FACIAL_CONNECTION_ERROR - User was presented the "motion connection error" screen during upload

Going live

Once you are happy with your integration and are ready to go live, please contact Client Support to obtain a live API token. You will have to replace the sandbox tokens in your code with the live tokens.

Check the following before you go live:

Migrating

You can find the migration guide at MIGRATION.md

Security

Certificate pinning

Note: Certificate pinning works only on devices running on iOS 10.3 or above.

You can pin any communications between our SDK and server through the .withCertificatePinning() method in our OnfidoConfig.Builder configuration builder. This method accepts CertificatePinningConfiguration as a parameter, with sha-256 hashes of the certificate's public keys. For more information about the hashes, please email ios-sdk@onfido.com.

Swift

swift
Copy
let config = try OnfidoConfig.builder()
... 
do {
    config.withCertificatePinning(try CertificatePinningConfiguration(hashes: ["<EXAMPLE_HASH>"]))
} catch {
    // handle CertificatePinningConfiguration initialisation failures. i.e Providing empty array causes initialiser to be failed.
}
...
configBuilder.build()

Objective-C

Objective-C
Copy
ONFlowConfigBuilder * builder =[ONFlowConfig builder];
...
NSError * error = NULL;
ONCertificatePinningConfiguration * pinningConf = [[ONCertificatePinningConfiguration alloc] initWithHashes: @[@"<EXAMPLE_HASH>"] error: &error]];
if (error != NULL) {
    // handle ONCertificatePinningConfiguration initialisation failures. i.e Providing empty array causes initialiser to be failed.
}
[builder withCertificatePinningConfiguration: pinningConf];

...

Handling certificate pinning error

To identify a certificate pinning error, check the message property of the OnfidoFlowError.exception object. It will return invalid_certificate for certificate pinning related errors.

Copy
let responseHandler: (OnfidoResponse) -> Void = { response in
  switch response {
    case let .error(error):
        // Some error happened
        if case OnfidoFlowError.exception(withError: _, withMessage: let optionalMessage) = error, let message = optionalMessage {
            if message == "invalid_certificate" {
                // HANDLE INVALID CERTIFICATE CASE HERE
            }
        }        
    case let .success(results):
        // User completed the flow
        // You can create your check here
    case .cancel:
        // Flow cancelled by the user
  }
}

Accessibility

The Onfido iOS SDK has been optimised to provide the following accessibility support by default:

  • Screen reader support: accessible labels for textual and non-textual elements available to aid VoiceOver navigation, including dynamic alerts
  • Dynamic font size support: all elements scale automatically according to the device's font size setting
  • Sufficient color contrast: default colors have been tested to meet the recommended level of contrast
  • Sufficient touch target size: all interactive elements have been designed to meet the recommended touch target size

Refer to our accessibility statement for more details.

Licensing

Due to API design constraints, and to avoid possible conflicts during the integration, we bundle some of our 3rd party dependencies. For those, we include the licensing information inside our bundle and also in this repo under license folder, with the file named onfido_licenses.json. This file contains a summary of our bundled dependencies and all the licensing information required, including links to the relevant license texts contained in the same folder. Integrators of our library are then responsible for keeping this information along with their integrations.

Example on how to access the licenses:

swift
Copy
let onfidoBundle = Bundle(for: OnfidoFlow.self)
guard let licensesPath = onfidoBundle.path(forResource: "onfido_licenses", ofType: "json", inDirectory: nil),
      let licensesData = try? Data(contentsOf: URL(fileURLWithPath: licensesPath)),
      let licensesContent = String(data: licensesData, encoding: .utf8)
else {
    return
}

print(licensesContent)

guard let mitLicensePath = onfidoBundle.path(forResource: "onfido_licenses_mit", ofType: "txt", inDirectory: nil),
      let mitLicenseData = try? Data(contentsOf: URL(fileURLWithPath: mitLicensePath)),
      let mitLicenseFileContents = String(data: mitLicenseData, encoding: .utf8)
else {
    return
}

print(mitLicenseFileContents)

More Information

Sample App

We have included sample apps to show how to integrate with the Onfido iOS SDK using both Swift and Objective-C. See the SampleApp and SampleAppObjC directories for more information.

Support

Should you encounter any technical issues during integration, please contact Onfido’s Customer Support team via email, including the word ISSUE: at the start of the subject line.

Alternatively, you can search the support documentation available via the customer experience portal, public.support.onfido.com.

Previous versions of the SDK will be supported for a month after a new major version release. Note that when the support period has expired for an SDK version, no bug fixes will be provided, but the SDK will keep functioning (until further notice).

Copyright 2023 Onfido, Ltd. All rights reserved.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Note: If the strings translations change it will result in a MINOR version change, therefore you are responsible for testing your translated layout in case you are using custom translations. More on language localisation

[29.7.1] - 2024-02-05

Fixed

  • Fixed SDK packaging that could lead to problems with SDK upgrade

[29.7.0] - 2024-01-18

Changed

  • Improved image icon color in dark mode on Motion's no face detected screen

Fixed

  • Fixed rare crash when opening document capture
  • Fixed infinite loading when the back button of the camera permission screen is pressed
  • Fixed Motion crash that can occasionally occur when user fails to complete head turn within the required timeframe, usually after multiple attempts

[29.6.0] - 2023-11-14

Added

  • UI customisation is now applied to Motion
  • Improved document capture image validation logic
  • Added support for the integration of Qualified Electronic Signature (QES) and One-Time Password (OTP) capture steps via Studio

Changed

  • NFC enforcement (through Studio) and UI/UX improvements added
  • Due to a change introduced by Apple in March 2023 with iOS v16.0, PACE-only documents can no longer be read by iOS devices installed with iOS 16 (or newer). To minimise integration complexity and instability with future releases of iOS, Onfido is removing support for NFC-PACE.

Fixed

  • Fixed issue where enterprise features were ignored for studio flows
  • Fixed Selfie confirmation screen text not being visible in Dark Mode and not using the custom font set
  • Fixed rare race condition that could cause Motion to crash
  • Fixed camera permissions checks to handle camera being restricted through "Content & Privacy restrictions"
  • Fixed showing a loading placeholder when configuring face step without intro video

[29.5.2] - 2023-10-19

Fixed

  • Fixed a blocking bug involving JSON encoding on iOS 11 & 12

[29.5.1] - 2023-10-05

Fixed

  • Added missing face capture confirmation event

[29.5.0] - 2023-09-21

Changed

  • Improved document country search accessibility
  • Changed NFC intro related translation keys

Fixed

  • Fixed issue where NFC scan was asked for unsupported documents without MRZ
  • Fixed media callbacks not working in Studio

[29.4.2] - 2023-09-15

Fixed

  • Fixed compilation warning about missing headers

[29.4.1] - 2023-09-04

Fixed

  • Fixed Studio document filtering considering passport for all countries
  • Fixed authentication issue with consecutive verification flows

[29.4.0] - 2023-08-08

Changed

  • Changed Face step border success colour in Video Step

Fixed

  • Fixed the issue that causes some documents to stuck on uploading screen

[29.3.0] - 2023-07-25

Added

  • Ability to customise logo and branding available on all Motion screens. This is an enterprise feature, please reach out to your CSM if you want to know more
  • Added translations for live feedback on wrong passport page or tilted document
  • Added screen background colour customisation
  • Introduced InterfaceStyle which enables you to either force set the dark/light theme, or follow the device’s system setting. The previous attribute supportDarkMode is now deprecated. Please use this instead. More details can be found here
  • When using Studio, Selfie and Video are configured based on the configuration set in Studio

Changed

  • Adjust colour contrast of brackets in Headturn step in motion
  • Adjust colour contrast of corners in Alignment step in motion
  • Added feedback on UI while video is being recorded on document capture
  • Increase document overlay width to 90% for all devices that do not have a 16:9 screen.
  • Removed OnfidoExtended framework variant

Fixed

  • Fixed umbrella header importing private header files
  • Added missing Norwegian localisations for document capture. Improved Hungarian message for wrong document side detected.
  • Fixed missing country setting issue on document capture Studio flow which affects capture UX and validations
  • Fixed incorrect image quality messages being reported on document confirmation screen after 3 attempts
  • Disabled swipe to dismiss gesture on loading screen in model presentation contexts
  • Fixed reporting the incorrect NFC Media ID in flow response
  • Fixed USA and Canadian API calls that were incorrectly calling EU servers
  • Fixed endless spinner appearing when navigating back from document capturing screen

[29.2.1] - 2023-07-24

Fixed

  • Fixed USA and Canadian API calls that were incorrectly calling EU servers

[29.2.0] - 2023-07-14

Added

  • Ability to customise logo and branding available on all Motion screens. This is an enterprise feature, please reach out to your CSM if you want to know more
  • Adding translations for live feedback on wrong passport page or tilted document.
  • Enable screen background colour customisation
  • Enable explicitly setting the user interface style
  • When using Studio, Selfie and Video are configured based on the configuration set in Studio
  • Fixed endless spinner appearing when navigating back from document capturing screen

Changed

  • Increase document overlay width to 90% for all devices that do not have a 16:9 screen.

Fixed

  • Fixed umbrella header importing private header files
  • Added missing Norwegian localisations for document capture. Improved Hungarian message for wrong document side detected.
  • Fixed missing country setting issue on document capture Studio flow which affects capture UX and validations
  • Fixed incorrect image quality messages being reported on document confirmation screen after 3 attempts
  • Disabled swipe to dismiss gesture on loading screen in model presentation contexts
  • Fixed reporting the incorrect NFC Media ID in flow response

[29.1.0] - 2023-06-16

Added

  • Enable consent screen buttons only when user scrolls to bottom of text
  • Added experimental feature to detect and validate document on device
  • Add swipe gesture for navigating back to previous viewControllers
  • Enabled NFC by default in OnfidoConfig. Added disable() for disabling it
  • Deprecated withNFCReadFeature() in OnfidoConfig
  • Combined NFC Intro & Read screens into single Scan screen
  • Add back swipe gesture for Photo, Video and Motion capture screens

Changed

  • Enhanced security around payload tampering
  • Removed Bitcode from binaries as it has been deprecated by Apple
  • Document capture: Hide shutter button momentarily when automatic capture is enabled

Fixed

  • Fix capture screen squeezed button and title design issue
  • Attempted fix for rare UI freeze and subsequent crash on Selfie step

[29.0.0] - 2023-05-03

Changed

  • Changed the Studio API to be compatible with Objective-C
  • Added Objective-C support for the Custom Media Callback feature
  • Removed Canadian driver's license autocapture beta feature withCanadianDrivingLicenceAutoCaptureBetaFeatureEnabled()

[28.3.2] - 2023-05-16

Fixed

  • Fixed SPM 28.3.1 packaging that was pointing to 28.3.0

[28.3.1] - 2023-04-18

Fixed

  • Fixed SPM 28.3.0 packaging that was pointing to 28.2.0

[28.3.0] - 2023-04-05

Changed

  • Enhanced security around payload tampering

Fixed

  • Fixed the text cut-off issue on document confirmation screen which happens on small screen devices (e.g iPhone SEs)
  • Fixed missing OnfidoApiError and OnfidoFlowError types

[28.2.0] - 2023-03-21

Added

  • Added user analytics tracked events for Motion

Changed

  • Fixed "Umbrella header missing" warnings with SPM

Fixed

  • Fixed OnfidoExtended framework variant

[28.1.0] - 2023-03-02

Changed

  • Added backward compatible withDocumentStep(ofType:... signature
  • Improved translations
  • Increased the Facial Similarity Video upload timeout from 5 seconds to 60 seconds

Fixed

  • Accessibility: Fixed Document capture VoiceOver support
  • Fixed potential crash when dismissing Motion during recording
  • Re-added missing FACIAL_INTRO event
  • Fixed issue with Privacy Notices and Consent screen appearing when not required

[28.0.1] - 2023-03-06

Fixed

  • Accessibility: Fixed Document capture VoiceOver support
  • Fixed potential crash when dismissing Motion during recording
  • Re-added missing FACIAL_INTRO event
  • Fixed issue with Privacy Notices and Consent screen appearing when not required

[28.0.0] - 2023-02-06

Added

  • Added ability to configure Motion face step to enable audio recording

Changed

  • Removed deprecated Document variant public APIs
  • Removed SegmentSDK for analytics
  • Removed requirement for hardcoded onfido_locale value in the Localised strings files

Fixed

  • Crash occurring with iOS 11/12
  • Crash occurring during document capture related to a rare race condition
  • Image orientation for RTL languages

[27.4.0] - 2023-01-13

Added

  • Support for NFC with ID Cards (PACEv2), CAN-based authentication

[27.3.0] - 2023-01-05

Changed

  • Reduce size of SDK binaries

[27.2.0] - 2022-12-22

Added

  • Extended localisation support to 44 languages
  • Added RTL languages support

Fixed

  • Fix issue with registration of Appearance
  • Fix crash when user stops recording video
  • Remove unnecessary camera exposure mode configuration

[27.1.0] - 2022-12-12

Added

  • Added support for address cards as proof of address in certain regions
  • Create Onfido Studio documentation file
  • Added Studio support for Motion

Changed

  • Added documentation for Motion to the README
  • : Add support of Dashboard feature to configure supported documents

Fixed

  • UI: Fixed the crash issue on iPads when device rotated while any alert is shown on UI

[27.0.0] - 2022-10-27

Added

  • Added ability to configure Motion face step with Photo or Video fallback in the case that Motion is unsupported by the device

Changed

  • Renamed withNFCReadBetaFeatureEnabled SDK configuration functions to withNFCReadFeatureEnabled

Fixed

  • Fix possibility that UI freezes when green checkmark displayed after successfully taking photo of document

[26.1.1] - 2022-10-20

Fixed

  • Fixed crash on devices without the ability to use pixel binning

[26.1.0] - 2022-09-30

Added

  • Motion can be set as the face step
  • UX Selfie improvements, the end users knows the image that Onfido is storing
  • Added support for DG11 and DG14 extraction on NFC
  • Added Image Quality Service validations when NFC is enabled

Changed

  • Increased image resolution and change camera stream UI (full width view in 4:3 aspect ratio) for document capture
  • Updated readme file to reflect the combined document type selection and country selection screen

Fixed

  • Fixed video freezing when another app has ongoing audio that we are unable to interrupt, displaying a message to the user when this is the case (most common case is ongoing phone calls)
  • Fixed end user stuck on Selfie-Video task

[26.0.1] - 2022-09-08

Fixed

  • Fix end user stuck on Selfie-Video task

[26.0.0] - 2022-08-10

Added

  • Set secondary button border color to equal secondaryTitleColor
  • Update readme file to reflect the combined document type selection and country selection screen

Fixed

  • Fix response handle doesn't fire in the iOS release 25.1.0
  • Disable image quality validations before submission on the backside of Romanian National Identity Cards (fixing issues with blank backsides)
  • Missing texts in DE locale

[25.2.0] - 2022-07-22

Added

  • Exposed Enterprise Features through WorkflowConfig

Fixed

  • Fixed crashing at end of the Studio flow in loading screen
  • Fixed error message to give a more accurate reason to the user when there is a missing media type connection error
  • UI: Fixed the issue which caused standard font to be shown even when the custom font feature was enabled
  • Fixed wrong screen being displayed and no error being returned after microphone permission denied
  • Fixed the issue where it was not possible to dismiss the SDK after the consent screen was shown
  • Fixed missing document types (Visa, Work permit, Generic) for customized withDocumentStep API

[25.1.1] - 2022-07-13

Added

  • Geoblocking alert at document upload

[25.1.0] - 2022-06-09

Changed

  • Improved NFC scanning tutorial with video

Fixed

  • Fix iOS fatal error for could not resolve BuildConfigurationRepository

[25.0.0] - 2022-04-21

Added

  • Remove user consent from the public API
  • Added secondaryTitleColor appearance configuration

Changed

  • Download updated supported countries for Proof of Address from endpoint
  • Make Proof of Address work with Orchestration workflows

[24.6.0] - 2022-04-11

Added

  • Includes the Alpha release of the Onfido next generation facial similarity product. To join the Alpha program customers need to get in touch with their sales representative.

[24.5.0] - 2022-03-31

Added

  • Added support for capture of documents for proof of address reports

Fixed

  • UI: Fixed the missing body label in the CaptureConfirmationScreen
  • NFC: Fixed the intro screen layout and user interaction
  • UI: Fixed iOS crashes on Obj-C interface

[24.4.0] - 2022-03-03

Added

  • Allow document type configurability on UI selection screen

Changed

  • Added dsyms into xcframework shipment

[24.3.0] - 2022-02-08

Changed

  • UI: Improve barcode detection failures user experience by reducing warnings
  • UI: Shutter button always visible, no longer hidden while waiting for auto-capture.
  • UI: Add turn icon to document back side capture screen

Fixed

  • No longer showing unsupported documents i.e. GBR National ID
  • Fixed a bug which caused not receiving analytics events on Objective-C interface
  • Fix layout constraints issues on Intro screens

[24.2.0] - 2022-01-04

Added

  • UI: Added language localisation for Dutch (NL)
  • Add instructions carousel to NFC intro screen
  • UI: Added support for capturing paper-based German driving license

Changed

  • Added: suggest user to hold the device still during the capture

Fixed

  • Updated iOS version in generated Package.swift file
  • The SelfieViewController was rarely crashing during viewDidLoad.

[24.1.0] - 2021-12-13

Changed

  • Now extracting face photo from NFC chips in documents so you can access that data on document report

Fixed

  • Now preventing crashes on the document capture coordinator by sending exceptions back to the integrator
  • Fixed SDK crashing app on launch on iOS 11 and 12 due to missing CoreNFC framework

[24.0.0] - 2021-12-07

Changed

  • Removed mobile token support
  • Dropped iOS 10 support. Now supporting iOS 11 or newer.
  • Removed initialisers with parameters for Appearance (ONAppearance) and CaptureSuccessColors (ONCaptureSuccessColors), and made properties public.
  • Renamed withPassportNFCReadBetaFeatureEnabled sdk configuration function to withNFCReadBetaFeatureEnabled.
  • Removed EnterpriseFeature convenience initialiser. Use EnterpriseFeatures.builder().withHideOnfidoLogo(_:).build() instead.

Fixed

  • Documentation correction for the document step in README file.

[23.1.0] - 2021-11-02

Added

  • UI: Now making sure applicant's face is within oval during selfie video capture
  • Updated document capture experience for better image quality (multiframe)
  • UI: Live document position feedback during capture

Changed

  • Added links on how to create a check containing a document report with NFC on the README

Fixed

  • Added missing NFC library license to onfido_licenses.json
  • Fix Xcode double quoted warning
  • Removed unused localisation keys and values
  • Removed unused and erroneous keys
  • Added missing IT and PT localisation files

[23.0.1] - 2021-10-22

Fixed

  • Improved iOS 15 compatibility

[23.0.0] - 2021-10-01

Added

  • This version of SDK is built using Xcode 13 and would allow building your app on Xcode 13. This version of SDK would only support building your app with Xcode 13 due to lack of backward compatibility introduced by Apple with Xcode 13.

Fixed

  • Added missing IT and PT localisation files
  • UI: Fix navigation bar color for iOS 15.

[22.4.0] - 2021-09-07

Changed

  • UI: Added loading spinner at the beginning of the flow when configuration is loaded.

[22.3.0] - 2021-08-31

Added

  • Added enterprise feature disableMobileSdkAnalytics

Fixed

  • Fixed missing thrown error when the user didn't give camera permission

[22.2.0] - 2021-08-09

Added

  • UI: Now autocapturing Netherlands ID
  • UI: Now able to extract NFC data from Netherlands Identity card

Changed

  • Accessibility: announcing successful autocapture for documents
  • Changed video bitrate configuration for document capture flow
  • Accessibility: announcing successful face and face turn detection
  • UI: Now fetching NFC key and properties from backend servers

Fixed

  • Fixed Canadian Driving Licence not autocapturing when CAN DL beta feature enabled

[22.1.0] - 2021-06-18

Added

  • UI: Added language localisation for italian(IT) and portuguese(PT)
  • Added nfcMediaId property to DocumentResult object

Changed

  • UI: Now uploading NFC extracted data to Onfido servers
  • UI: Copy updates

[22.0.0] - 2021-06-10

Added

  • UI: Image quality service integration
  • UI: Ability to customise button corner radius

Changed

  • Accessibility: improved instructions for capturing various document types
  • Accessibility: improved instructions for selfie camera capture
  • Now returning a single document and face result object. Only last capture returned.
  • Accessibility: announcing number of results when searching for countries
  • UI: Now showing auto capure message below capture frame area. Same as manual capture.
  • UI: Now showing capture instructions at all times even when warning present to user
  • Accessibility: improved the instruction for selfie and video capture
  • Accessibility: added reference that video is being played on intro video screen
  • UI: Now showing spinner instead of deterministic progress bar

Fixed

  • Value of keys onfido_video_intro_list_item_time_limit and onfido_video_intro_list_item_move_speak were swapped
  • Fixed residence permit documents sent as unknown document type

[21.4.0] - 2021-04-12

Added

  • Added ability to remote config blur detection for image quality optimisation

Changed

  • Swapped primary and secondary key names for consent denied prompt

[21.3.0] - 2021-04-06

Added

  • M1 Mac support

Fixed

  • Fixed prod appending wrong path to framework link on Package.swift

[21.2.0] - 2021-03-29

Added

  • UI: Now managing consent screen content load error

Changed

Fixed

  • Removed incorrect keys mentioned in MIGRATION.MD document
  • Fixed user cancellation Objective-C API. Now returning correct status.
  • Updated README.MD to correct the function name to enable user consent screen for swift interface

[21.1.0] - 2021-03-18

Changed

  • Now forcing user to retake image when blurry

[21.0.0] - 2021-03-01

Added

  • UI: Added consent screen
  • Now sending user reached consent screen to tracked evenets

Changed

  • UI: Added cancellation prompt to consent screen
  • Updated README to provide solution for potantial App Rejection problems related with NFC

Fixed

  • Fixed onfido_locale value in Localizable.strings for German language

[20.1.0] - 2021-02-01

Changed

  • UI: Updated upload progress view design

[20.0.1] - 2021-01-20

Fixed

  • Fixed Swift Package Manager Package.swift pointing to the wrong SDK build

[20.0.0] - 2021-01-18

Added

  • UI: Added accessibility header traits to title and section header elements
  • Now support Swift Package Manager(SPM) as dependency manager

Changed

  • Changed dynamic framework format from fat universal framework to xcframework
  • UI: Changed voiceover behaviour to focus on main content rather than back button on the SDK screen. (only for iOS 13+ versions)
  • Updated README clarify Xcode version support

Fixed

  • UI: Fixed progress bar not reflecting progress
  • UI: Fixed liveness capture reloading delay after retry on timeout
  • UI: Fixed the errors in translation (strings) files
  • Now returning error to the integrator if the camera device does not function properly

Removed

  • Carthage support due to Carthage not supporting XCFramework

[19.0.0] - 2020-12-07

Added

  • Added Canadian driver's license autocapture as an experimental feature. Follow README to understand how to enable this feature

Changed

  • Now sending selected document country information to the API
  • UI: Country list items are treated as button for better accessibility

Fixed

  • UI: Fixed the bug causing stuck on country search screen when the search mode and voice over are on

[18.10.1] - 2020-11-26

Fixed

  • Fixed certificate pinning bug which causes all network requests fail with invalid_certificate error message when withCertificatePinning is used

[18.10.0] - 2020-11-24

Added

  • UI: Added search functionality on country selection screen
  • UI: Added shadow view on scrollable views

Changed

  • UI: Improved US DL autocapture experience
  • Updated readme to mention NFCReaderUsageDescription key in app permission section
  • UI: Updated video capture confirmation
  • Now sharing .strings files for all supported languages

Fixed

  • UI: Fixed capture confirmation error bubble not being read by VoiceOver as the first view

[18.9.0] - 2020-10-27

Added

  • Added ability to skip selfie intro.
  • UI: User can now enlarge capture document for detailed inspection

Changed

  • UI: Changed text and background colors in light mode
  • Now sharing Onfido license files in github repository along with SDK bundle
  • UI: Changed Onfido logo position in capture screens
  • UI: Changed Onfido logo position in intro and permission screens
  • UI: Added Onfido logo to the document type selection screen
  • Removed unused strings from localisation
  • Renamed some generic keys
  • UI: Changed bubble view position and appearance for document capture flow
  • Now disabling passport autocapture on simulators

Fixed

  • UI: Now showing wrong side head turn warning again
  • UI: Fixed the incorrect captured document position on confirmation screen for multi format document types

[18.8.1] - 2020-10-22

Fixed

  • UI: Fixed several bugs causing camera freeze, laggy interaction on document capture screen

[18.8.0] - 2020-10-07

Changed

Fixed

  • UI: Not preventing interactive dismissal of SDK view controllers while presented modally on iPad to not have unexpected flow issues

[18.7.0] - 2020-09-30

Added

  • UI: Passport NFC read feature (beta)

Fixed

  • UI: Fixed liveness pre-recoding screen stuck on loading state after retrying connection when connection is established

[18.6.0] - 2020-09-21

Changed

  • Post capture confirmation error bubble on modals now grows to button width
  • Removed 'Version' prefix on github release title to align with other Onfido SDKs

Fixed

  • UI: Fixed the crash problem when SDK integrates to the app running on Xcode 12 project
  • UI: Fixed user able to go back during face video upload

[18.5.0] - 2020-09-14

Added

  • Added support for South African ID folded paper document capture

Changed

  • UI: Removed separator line from the UI
  • UI: Removed timer icon from subtitle in welcome screen

Fixed

  • UI: Fixed the problem about showing pause button right after playing video on liveness intro screen
  • UI: Re-added onfido_message_capture_face key which is for screen reader (accessibility) during liveness capture flow

[18.4.0] - 2020-08-27

Added

  • UI: Now auto capturing Passport documents
  • Added configuration option to enable manual liveness capture

[18.3.3] - 2020-08-17

Fixed

[18.3.2] - 2020-08-06

Changed

  • UI: Removed Singapore endonym

Fixed

  • UI: Fix the problem about having buttons in different height. Github Issue
  • Fixed localisation language selection when app and device preferred language is not supported by Bundle

[18.3.1] - 2020-07-27

Fixed

  • Fix for sending duplicate VIDEO_FACIAL_CAPTURE_CONFIRMATION analytic event.Related github issue
  • Improved memory usage
  • UI: Fixed the camera load problem in some specific cases
  • UI: Fixed incorrect VoiceOver focus on video capture intro video
  • UI: Fixed error problem user taps shutter button right after presenting SDK.Related github issue

[18.3.0] - 2020-07-03

Changed

  • Removed unnecessary advertisingIdentifier usage

Fixed

  • Fixed folded paper documents confirmation showing warning and instructions texts when returning from following step

[18.2.0] - 2020-06-17

Added

  • Enterprise can cobrand Onfido logo

Changed

  • UI: Changed continuous glare detection logic for US DL documents
  • UI: Autocapture manual fallback alert UI has changed
  • UI: No longer running glare validation on back side of Romanian identity card
  • Added eventHandler and corresponding event method to ONFlow.swift for User Analytic Events
  • UI: Improved US Driver Licence edge detection
  • Sending barcode detection result to the API

Fixed

  • Fixed the face similarity report documentation url in README.

[18.1.1] - 2020-06-03

Changed

  • Updated SampleApps to clarify modalPresentationStyle setting

Fixed

  • Fixed SDK crash when invalid SDK token provided
  • Fixed sdk not showing document format selection when document type and country preselected but no format specified
  • UI: Fix the issue related with having incorrect navigation bar theme when dark mode disabled for SDK
  • UI: Now showing upload progress when user taps upload button immediately

[18.1.0] - 2020-04-30

Added

  • UI: Now showing document template for US driving licence front capture
  • Added enterprise feature 'hideOnfidoLogo

Changed

  • UI: Updated Onfido logo
  • Now voice over read upload alert view element when uploading image or video
  • Added information on api/token regions to documentation
  • UI: Changed screen reader order (Accessibility)
  • UI: Removed selfie capture title

Fixed

  • UI: Fixed the problem about having unnecessary extra height for primary button when onfido logo is hidden

[18.0.0] - 2020-04-20

Added

  • Added German as supported language
  • Added document format option for document capture step. Also changed the way to configure document capture step. Please check README for the details
  • Added integrator defined event hook to allow integrators to collect user analytics
  • UI: Added icon to differentiate document back capture from front capture

Changed

  • UI: Now showing play pause button on liveness intro without delay
  • UI: Now allowing user to proceed during selfie capture process on simulator

Fixed

  • Fixed the Localizable.strings not updated problem.See
  • UI: Fixed missing right margin issue on selfie intro screen
  • UI: Fixed alert text cut off in some scenarios
  • UI: Fixed the text cut-off issue on liveness capture screen

[17.0.0] - 2020-02-27

Added

Changed

  • UI: Now using grey Onfido logo with higher contrast for accessibility
  • Now using API v3 for communication with the backend.
  • UI: Now only detecting glare on rectangles of ID1 size on US DL autocapture
  • UI: Now auto capturing non-blurry US DL only
  • Updated bubble view design and updated barcode not readable copy
  • Removed deprecated withApplicant() function from public API. Please check migration document to understand what needs to be done.
  • UI: Updated liveness capture head turn challenge design
  • Updated code snippets and descriptions about API v2 with API v3 in README.
  • UI: Selfie oval now same as liveness oval size
  • Updated README to include bitcode support information
  • UI: Updated flow intro screen user interface
  • Updated mrz not detected error copy
  • Changed 'mobile sdk token' expression with 'mobile token' on README to prevent confusion
  • UI: Now running selfie capture validation on device instead of back-end
  • UI: Now showing selfie capture post upload errors in bubble view instead of using pop-ups
  • UI: Now loading selfie intro screen purely from code; Removed Xib file

Fixed

  • Fixed folded paper document on back capture loading lag issue
  • UI: Fixed selfie capture text truncated when large text size used
  • UI: Fixed Arabic country name endonyms
  • Fixed warning about missing umbrella header (https://github.com/onfido/onfido-ios-sdk/issues/131)

[16.2.0] - 2020-02-24

Changed

  • UI: Now showing next or finish recording button with 3 second delay on recite digit challenge view when head turn detection available

Fixed

  • UI: Fixed flow early exit on document upload double tap

[16.1.1] - 2019-12-17 - [enterprise]

Fixed

  • UI: Fixed liveness intro video play error on static SDK

[16.1.0] - 2019-12-05

Added

  • UI: User can choose to capture folded paper documents for French driving license and italian identity document
  • UI: Now checking face is in document captured when document must contain face
  • UI: Now showing error message when passport MRZ is cut off in captured image
  • Now changing document capture frame ratio for folded paper documents and showing document template for 4 seconds
  • Now showing passport template when user selects passport capture

Changed

  • UI: Changed voiceover message when it focuses on the liveness intro video

Fixed

  • Now both swift and objective-c version of SampleApps are consistent and up-to-dated.
  • UI: Fixed photo post capture error bubble view not scaling with user defined font scale

[16.0.0] - 2019-11-11

Added

  • New generic document type added
  • UI: User now sees blurry photo message when document capture is blurry

Fixed

  • UI: Fixed white background shown on camera capture screens
  • Cocoapods documentation is now pointing to GitHub README

[15.0.0] - 2019-10-31

Changed

  • UI: Now showing manual capture option on retake when autocapturing US DL
  • UI: Now showing manual capture for US DL when only barcode detected
  • Updated README to explain how to obtain sandbox token
  • Changed carthage spec json file name. Please check the README for the details.
  • Now captured images include EXIF meta data.

[14.0.0] - 2019-10-07

Added

  • Carthage support added, please check the README for the details.

Changed

  • UI: Liveness pre-recording loader fades out and instructions now fades in. Also "Start recording" slides in from the bottom.

Fixed

  • UI: Fixed the UI bug which affects navigation bar in camera screens when integrator uses global appearance customisation for the navigation bar
  • UI: Fixed the issue that causes showing constraint warnings in the console when user goes to the any camera capture screen
  • UI: VoiceOver focuses on back button instead of take new picture on capture confirmation screen when transitioning between photo capture to capture confirmation
  • Fixed Segment SDK crash issues, upgraded Segment SDK version to 3.7.0

[14.0.0-rc] - 2019-09-12

Added

  • SDK Token support for US region

Fixed

  • UI: Liveness challenges security fix

[14.0.0-beta] - 2019-08-29

Changed

  • UI: US driving license autocapture manual capture fallback message now announced in bubble instead of bottom bar view

Fixed

  • UI: Face capture confirmation now scrolls on when large text used

[13.2.0] - 2019-08-22

Fixed

  • UI: User has to retake on document capture when no document is found on current capture

[13.1.0] - 2019-08-14

Added

Changed

  • UI: When auto capturing a US DL, the transition to manual capture will only happen after 10 seconds of the first document is detected (even if not aligned)
  • UI: Changed document not found pop-up for error bubble on capture confirmation upload
  • US driving license autocapture now default feature.

Fixed

  • UI: Fixed the not being able to set correct font issue on iOS 13
  • UI: Fix for the separator disappear problem when any document type tapped on iOS 13
  • UI: Fixed the not showing unsupported orientation view for flow intro and selfie intro screens when device in horizontal mode
  • UI: Fixed the crash on liveness head turn challenge screen when head turn animation and tapping next button happened at the same time
  • UI: Fixed liveness intro video player and video reload showing at the same time
  • UI: Error bubble view on capture confirmation view cut off on iPad modal

[13.0.0] - 2019-07-17

Added

  • UI: Added edge detection feedback on US driving license autocapture
  • Added SDK token support

Changed

  • UI: Now returning UI feedback on document alignment on US driving license autocapture when face or barcode not detectable but correct document shape

Fixed

  • UI: Fixed the liveness video corruption issue on iOS 13

[12.2.0] - 2019-07-02

Added

  • Added United States' driver's license autocapture as an experimental feature. Can be enabled by calling withUSDLAutocapture() in the OnfidoConfig.builder()
  • Updated README with adding SDK size impact information
  • UI: Added dynamic font size support for video capture confirmation screen
  • UI: Added support for the new token format

Fixed

  • UI: Unsupported screen appears and gets stuck in app only supporting portrait mode
  • UI: Fixed the UI issue about showing unnecessary oval shape in upload progress bar view
  • UI: Poland's endonym on country selection screen
  • UI: Fixed the crash on iPad for the apps that support only landscape orientation

[12.1.0] - 2019-06-18

Changed

  • UI: Improved the video capture challenge generation and added error handling

[12.0.0] - 2019-05-29

Added

  • UI: New faceStep config added for not showing video in liveness intro screen

Changed

  • UI: Optimised liveness intro videos resolution and duration, reducing overall size

[11.1.2] - 2019-05-23

Fixed

  • UI: User sees liveness intro screen after app is backgrounded during liveness capture
  • UI: Device permission screen labels overlapping with icon when user setting has larger text size
  • UI: Fix for having wrong sized record button on liveness capture screen in some dynamic font size configured cases
  • UI: Fixed crash when tapping two buttons on capture confirmation screen at the same time
  • Removed unnecessary string keys
  • SDK does not throw OnfidoFlowError.microphonePermission when face capture photo variant is used and app has microphone permission denied

Added

  • UI: Play/Pause functionality for liveness intro video added

[11.1.1] - 2019-04-29

Fixed

  • Fixed full bitcode not included in universal Onfido framework (named Onfido-Debug or just Onfido)

[11.1.0] - 2019-04-25

Added

  • UI: Added work permit document type support(beta)
  • UI: Accessibility voiceover improvements for all screens
  • UI: Camera, Microphone and both camera and microphone permission screens added before requesting permissions

Changed

  • UI: Changed document capture area ratio for passport
  • UI: Changed circle loading indicator to progress bar for document and video upload progress

Fixed

  • UI: Accessibility voiceover improvements for all screens
  • UI: Fixed crash issue during recording video in some cases

[11.0.1] - 2019-04-08

Fixed

  • fixed debug SDK not compiling for simulators
  • fixed nullability warning

[11.0.0] - 2019-04-01

Added

  • UI: Showing bubble for wrong head turn detection on liveness screen
  • UI: Added dynamic font size support for flow intro and selfie intro screens
  • UI: Added dynamic font size support for liveness capture screen
  • UI: Added dynamic font size support for bubble views that appears in photo capture, liveness head turn detection and capture confirmation screens
  • UI: Added dynamic font size support for liveness intro screen
  • UI: Added dynamic font size support for photo capture confirmation screen
  • UI: Added dynamic font size support for buttons
  • UI: Added dynamic font size support for document photo capture screen
  • UI: Added french localisation
  • Allowing custom localisation from non-localised strings file

Fixed

  • UI: Fixed crash when capture and retake buttons tapped continuously
  • Fixed SDK not throwing error when user denies microphone permission during liveness capture (face capture video variant)

[10.6.0] - 2019-03-12

Added

  • UI: Added real time head turn progress for liveness screen

Changed

  • UI: Flow intro shows arrow icon instead of numbered icon when single SDK configured with single capture step

Fixed

  • UI: Arrow on glare detection bubble and barcode undetected bubble not separated from main rectangle containing text
  • fixed incorrect cropping of document image when document capture started on landscape

[10.5.0] - 2019-03-06

Added

  • UI: Added optional welcome intro screen
  • UI: Added selfie (face capture photo variant) intro screen
  • UI: Added dynamic font size support for document type selection screen
  • UI: Added dynamic font size support for country selection screen
  • UI: Added latency for face detection on liveness capture (face capture video variant) to allow readability of instructions

Changed

  • UI: Increased capture screens opacity for accessibility
  • UI: Country selection screen label text (onfido_country_selection_toolbar_title and onfido_unsupported_document_description)
  • Improved the documentation about onfido_locale string

Fixed

  • UI: Fixed text cut-off issue on liveness instructions screens when user language is Spanish
  • UI: Fixed Onfido logo and video playback view overlapping issue in liveness intro screen
  • Fixed cut-off issue on document images captured on certain iPads
  • Fix for the intermittent video cut-off issue when liveness capture recorded on certain iPads
  • Removed unused assets

[10.4.0] - 2019-02-07

Added

  • Integrators can now specify strings file bundle location
  • UI: Added visa document type support with UI vignette

Changed

  • UI: Added video tutorial to liveness intro screen
  • UI: Updated primary and secondary pressed state color
  • UI: updated liveness capture buttons design

[10.3.0] - 2019-01-28

Added

  • UI: Ability to customise Font-Family

Fixed

  • UI: Subtitle text truncate issue fixed on document selection screen
  • UI: Fix for the crash on iPad when switch to landscape mode

Changed

  • UI: Changed button colors on country selection screen.

[10.2.0] - 2019-01-04

Added

  • UI: Document and face capturing processes are now properly followed by screen readers
  • UI: Document type selection buttons are now properly read by screen readers
  • UI: UI changes on secondary button

Fixed

  • UI: Fix sdk crash on capture during the backside capture of two sided document on Cordova
  • UI: Fix for the Segment SDK name clash
  • UI: Fix infinite spinning wheel not removed when liveness upload failed.
  • UI: Fixed custom localisation of text in liveness confirmation screen now going over multiple lines when text too long (max three)

Changed

  • UI: Changed colors of the UI elements regarding to the new Onfido branding.
  • UI: Onfido logo updated.
  • UI: Improved UI for sdk flow with formSheet modal presentation style
  • UI: Changed UI on liveness intro screen

[10.1.0] - 2018-11-14

Added

  • UI: Managing request timeouts mid flow.
  • UI: Now detecting face is within oval before starting liveness recording
  • Ability to customise buttons and icons colors

Changed

  • UI: Changed copy on Liveness Intro screen
  • UI: Confirm and cancel buttons redesigned
  • Internal: Updated the map for the supported countries for each document

[10.0.0] - 2018-09-13

Changed

  • UI: Changed copy on the selfie capture screen
  • No longer compatible with Swift 4.1 and Swift 3.3, now compatible with Swift 4.2 and Swift 3.4.

Removed

  • UI: Removed label from capture confirmation screen

Fixed:

  • Build status on readme not rendering
  • Xcode warnings on missing headers

Removed:

  • Swinject from external dependency list
  • No longer using ZSWTappableLabel and ZSWTaggedString dependencies

[9.0.0] - 2018-09-03

Added

  • ability to run SDK on simulator

Removed

  • No longer using SwiftyJSON

Fixed

  • UI: SDK crash when tapping screen on face photo capture

[8.0.0] - 2018-08-01

Added:

  • Internal: Added the language displayed by the SDK as a parameter on the live video upload, for speech analysis purposes.

Changed

  • Flow now dismisses upon completion unless shouldDismissFlowOnCompletion set to false
  • Internal: Changed our analytics solution from an external provider to an in-house service

Removed

  • SDK no longer supports iOS 8. Now iOS 9+.

Fixed

  • UI: Glare detection bubble localisation breaking when custom localisation with long text is used.

[7.2.0] - 2018-07-17

Note: This version might be a breaking change if you are providing customised language translations. Please see MIGRATION.md.

Added

  • UI: country selection screen to filter for document type and country combination supported by Onfido
  • UI: user can now retry upload when internet connection is lost
  • post capture barcode detection for United States driving license captures

Fixed

  • UI: sdk crash when quickly transitioning between document type and document capture screens

[7.1.0] - 2018-06-07

Note: This version might be a breaking change if you are providing customised language translations. Please see MIGRATION.md.

Changed

  • UI: document type selection is now its own screen with refreshed design
  • UI: user flow back navigation is now a natural screen back

Removed

  • Removed Alamofire dependency
  • Removed MBProgressHUD dependency

Fixed

  • UI: Powered by Onfido logo size and position inconsistencies between document/face capture and confirmation.
  • UI: Powered by Onfido logo position change after rotation in doc/face capture confirmation screen

[7.0.0] - 2018-04-17

Note: This version might be a breaking change if you are providing customised language translations. Please see MIGRATION.md.

Changed

  • UI: Updated error dialogs copy

Fixed

  • upload results objects now exposing to objective-c integrator
  • UI: Fixed possible crash on camera capture
  • UI: Fixed crash on rotation during live video recording
  • UI: Fixed crash on going back from preselected document capture screen while glare detected
  • UI: Fixed back button with English text on non-English language text flow

[6.0.0] - 2018-04-04

Note:

  • This version is not backwards-compatible. Migration notes can be found in MIGRATION.md

Changed

  • SDK built using Swift 4.1 and Xcode 9.3

[5.6.0] - 2018-03-16

Added

  • Added custom language localisation option using withCustomLocalization() method when configuring the flow
  • UI: Added translation for Spanish (es)

Changed

  • Objective-C integrator no longer has to hold a strong reference to ONFlow instance during flow execution

Fixed

  • UI: Fixed a crashed that happened when starting the sdk and tapping the back button quickly

[5.5.0] - 2018-03-05

Added

  • Objective-C interface allows document type to be specified as part of the document step configuration

Changed