Technical reference
- Web SDK
- Android SDK
- iOS SDK
- API Reference
- SDK 21
- - 21.0.0
- SDK 20
- - 20.1.0
- - 20.0.1
- - 20.0.0
- SDK 19
- - 19.0.0
- SDK 18
- - 18.10.1
- - 18.10.0
- - 18.9.0
- - 18.8.0
- - 18.7.0
- - 18.6.0
- - 18.5.0
- - 18.4.0
Overview
Onfido's iOS input-capture SDK provides a drop-in set of screens and tools for iOS applications. These allow your app to capture identity documents, live photos and live videos for identity verification. The Onfido SDK offers a number of benefits to help you create the best onboarding and identity verification experience for your customers:
- carefully designed UI to guide your customers through the entire 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 requirements of the Onfido identity verification process, guaranteeing the best success rate
- direct image upload to the Onfido service, to simplify integration
The SDK is only responsible for capturing and uploading photos and videos. You still need to access the Onfido API to create and manage checks.
- SDK supports iOS 10+
- SDK supports Xcode 11+
- SDK has full bitcode support
- SDK supports the following presentation styles:
- only full screen style for iPhones
- full screen and form sheet styles for iPads
The Onfido SDK requires CoreNFC to run. Since XCode 12 there is a bug where libnfshared.dylib
is missing from simulators. See stackoverflow to solve this problem.
1. Obtaining an API token
To start integrating, you will need an API token. You can use our sandbox environment to test your integration, and you can create sandbox tokens inside your Onfido Dashboard.
1.1 Regions
Onfido offers region-specific environments. Refer to the regions section in our API reference documentation for token format and API base URL information.
2. Creating an applicant
You can create an Onfido applicant from your backend server, using a valid API token.
For Document and Facial Similarity reports, the minimum applicant details required are firstName
and lastName
.
Example applicant creation request:
$ curl https://api.onfido.com/v3/applicants \ -H 'Authorization: Token token=YOUR_API_TOKEN' \ -d 'first_name=Theresa' \ -d 'last_name=May'
The JSON response contains an id
field containing a UUID (universally unique identifier) that identifies the applicant. When you pass the applicant ID to the SDK, all documents, live photos and live videos uploaded by that instance of the SDK will then be associated with that applicant.
If you're using API v2, please check out API v2 to v3 migration guide to understand which changes need to be applied before starting to use API v3.
3. Configuring the SDK with tokens
We support 2 token mechanisms:
SDK token
Mobile token
We strongly recommend using an SDK token. It provides a more secure means of integration, as the token is temporary and applicant id-bound.
SDK Token
You will need to generate and include an SDK token every time you initialise the SDK.
To generate an SDK token you should perform a request to the 'generate SDK token' endpoint in the Onfido API.
If you're using an SDK token, do not call the withApplicantId
function.
$ curl https://api.onfido.com/v3/sdk_token \ -H 'Authorization: Token token=YOUR_API_TOKEN' \ -F 'applicant_id=YOUR_APPLICANT_ID' \ -F 'application_id=YOUR_APPLICATION_BUNDLE_IDENTIFIER'
Make a note of the token value in the response, as you will need it when initialising the SDK.
SDK tokens expire 90 minutes after creation.
The SDK token configurator function has an optional parameter called expireHandler
which can be used to generate and pass an SDK token when it expires. Using this parameter you can make sure that the SDK will continue its flow even after the SDK token has expired.
Example Usage
Swift
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_HERE", expireHandler: getSDKToken)
Objective C
-(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_HERE" expireHandler:^(void (^ handler)(NSString * expireHandler)) { [self getSDKToken:handler]; }];
Mobile Tokens
Mobile token usage is still supported, but it will be deprecated in the future. If you are starting a project, we would strongly recommend that you use SDK tokens instead.
In order to start integration, you will need an API token and a mobile token. You can use our sandbox environment to test your integration, and can generate and manage tokens inside your Onfido Dashboard.
You MUST use the mobile token and not the API token when configuring the SDK itself.
Example Usage
Swift
let config = try! OnfidoConfig.builder() .withToken("YOUR_MOBILE_TOKEN_HERE") .withApplicantId("APPLICANT_ID_HERE")
Objective C
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; [configBuilder withToken:@"YOUR_MOBILE_TOKEN_HERE"]; [configBuilder withApplicantId:@"APPLICANT_ID_HERE"];
4. App permissions
The Onfido SDK makes use of the device camera. You will be required to have the NSCameraUsageDescription
, NSMicrophoneUsageDescription
, NFCReaderUsageDescription
keys in your application's Info.plist file. Both keys will be required for app submission.
<key>NSCameraUsageDescription</key> <string>Required for document and facial capture</string> <key>NSMicrophoneUsageDescription</key> <string>Required for video capture</string>
5. Adding the SDK dependency
Using Cocoapods
The SDK is available on Cocoapods and you can include it in your projects by adding the following to your Podfile:
pod 'Onfido'
Run pod install
to get the SDK.
Using Carthage
The SDK is available on Carthage and you can include it in your projects by adding the following to your Cartfile:
binary "https://raw.githubusercontent.com/onfido/onfido-ios-sdk/master/onfido-carthage-spec.json"
Run carthage update
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.
- Download the compressed debug zip file containing the
Onfido.framework
- Uncompress the zip file and then move the
Onfido.framework
artefact into your project - Add
Onfido.framework
located within your project to theEmbedded binaries
section in theGeneral
tab of your iOS app target - Open your app's project file in Xcode. Then select your app's target under target list. Next select
Build Phases
tab and underEmbed Frameworks
step add a newRun Script Phase
. Name itOnfido Framework Archive
. In the text area add the following code:
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 with the following contents:
/* This file is required to force Xcode to package Swift runtime libraries required for the Onfido iOS SDK to run */ 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") }
Additionally you must also set Always Embed Swift Standard Libraries
to Yes
in your project configuration.
The above code and configuration will force Xcode to package the required Swift runtime libraries required by the Onfido SDK to run.
6. Creating 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
let config = try! OnfidoConfig.builder() .withSDKToken("YOUR_SDK_TOKEN_HERE") .withWelcomeStep() .withDocumentStep() .withFaceStep(ofVariant: .photo(withConfiguration: nil)) .build() let onfidoFlow = OnfidoFlow(withConfiguration: config) .with(responseHandler: { results in // Callback when flow ends })
Objective-C
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; [configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"]; [configBuilder withWelcomeStep]; [configBuilder withDocumentStep]; 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. Starting the flow
Swift
let onfidoRun = try! onfidoFlow.run() self.present(onfidoRun, animated: true, completion: nil) //`self` should be your view controller
Objective-C
NSError *runError = NULL; UIViewController *onfidoController = [onFlow runAndReturnError:&runError]; if (runError == NULL) { [self presentViewController:onfidoController animated:YES completion:NULL]; }
Congratulations! You have successfully started the flow.
Carry on reading the next sections to learn how to:
- handle callbacks
- customise the SDK
- create checks
Handling callbacks
To receive the result from the SDK flow, you should pass a callback to the instance of OnfidoFlow
(ONFlow
for Objective-C). Typically, on success, you would create a check on your backend server.
The result object passed to the callback may include the following attributes for Swift:
.success([OnfidoResult])
.error(Error)
.cancel
For an Objective-C based interface an instance of ONFlowResponse
is passed back to the callback with three properties:
results
error
userCanceled
: WhenuserCanceled
is false thenresults
orerror
properties will be set
Swift
let responseHandler: (OnfidoResponse) -> Void = { response in switch response { case let .error(error): // Some error happened case let .success(results): // User completed the flow // You can create your check here case .cancel: // Flow cancelled by the user } }
Objective-C
(^responseHandlerBlock)(ONFlowResponse *response) { if (response.userCanceled) { // Flow cancelled by the user } else if (response.results) { // User completed the flow // You can create your check here } else if (response.error) { // Some error happened } }
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:
OnfidoResult.document
OnfidoResult.face
Its payload is relevant in case you want to manipulate or preview the captures in some way. Keep reading to find out how to extract the payload of each OnfidoResult
enum value.
Objective-C
[ONFlowResult]
is a list with multiple results.
The result is an instance of ONFlowResult
containing two properties:
type
- which is an enum with values
ONFlowResultTypeDocument
andONFlowResultTypeFace
- which is an enum with values
result
- which instance type can be of
ONDocumentResult
orONFaceResult
. The result type can be derived by thetype
property
- which instance type can be of
Capture result payload
Under normal circumstances, you would not need to inspect the results of the captures themselves, as the SDK handles file uploads for you. However, if you want to see information regarding the document and face captures, you can access the result object as follows:
Swift
let document: Optional<OnfidoResult> = results.filter({ result in if case OnfidoResult.document = result { return true } return false }).first if let documentUnwrapped = document, case OnfidoResult.document(let documentResponse) = documentUnwrapped { /* documentResponse Onfido API response to the upload of the document More details: https://documentation.onfido.com/#upload-document */ print(documentResponse.id) // use documentResponse.href to fetch the captured image if required }
Face follows a similar structure to document, but the case
is OnfidoResult.face
instead of OnfidoResult.document
.
Objective-C
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) { /* documentResponse Onfido API response to the upload of the document More details: https://documentation.onfido.com/#upload-document */ ONDocumentResult *documentResult = ((ONFlowResult *)flowWithDocumentResults[0]).result; NSLog(@"%@", documentResult.id); // use documentResponse.href to fetch the captured image if required }
Face follows a similar structure to document, change the type ONFlowResultTypeDocument
for ONFlowResultTypeFace
.
Error handling
Response Handler Errors
Swift
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.
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.failedToWriteToDisk: // It happens when the SDK tries to save capture to disk, maybe due to a lack of space case OnfidoFlowError.microphonePermission: // It happens when the user denies permission for microphone usage by the app during the flow 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 default: // necessary because swift } }
Not all cases that are part of OnfidoFlowError
will be passed to OnfidoResponse.error
. There is one case where the error will be returned as an exception. See Run Exceptions and Configuration errors.
Objective-C
The error
property of the ONFlowResponse
returned to the callback block is of type NSError
. You can easily identify the error by comparing the code
property of the NSError
instance with ONFlowError
, i.e. response.code == ONFlowErrorCameraPermission
. You could also find out more about the error by printing or logging the userInfo
property of the NSError
instance. The NSError
contained within the ONFlowResponse
's error
property can be handled such as:
switch (error.code) { case ONFlowErrorCameraPermission: // It happens if the user denies permission to the sdk during the flow break; case ONFlowErrorFailedToWriteToDisk: // It happens when the SDK tries to save capture to disk, maybe due to a lack of space break; case ONFlowErrorMicrophonePermission: // It happens when the user denies permission for microphone usage by the app during the flow 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; }
Not all cases that are part of ONFlowError
will be passed to response handler block. There is one case where the error will be returned as an exception. See Run Exceptions and Configuration errors.
Run exceptions
When initiating the SDK there can be an exception.
Swift
You can handle run exceptions in Swift with a do/catch
as shown below:
do { let onfidoRun = try self.onfidoFlow!.run() self.present(onfidoRun, animated: true, completion: nil) } 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 } }
Objective-C
You can handle run exceptions in Objective-C as shown below:
NSError *runError = NULL; UIViewController *onfidoController = [onFlow runAndReturnError:&runError]; 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; } } else { [self presentViewController:onfidoController animated:YES completion:NULL]; }
Configuration errors
The following are required when configuring the Onfido iOS SDK:
- mobile token
- applicant
- at least one capture step
Otherwise you may encounter the following errors when calling the build()
function on the OnfidoConfig.Builder (ONFlowConfigBuilder
in Objective-C) instance:
OnfidoConfigError.missingToken
(Swift)ONFlowConfigErrorMissingSteps
(Objective-C)- No or empty string token provided
OnfidoConfigError.missingApplicant
(Swift)ONFlowConfigErrorMissingApplicant
(Objective-C)- No applicant instance provided
OnfidoConfigError.missingSteps
(Swift)ONFlowConfigErrorMissingSteps
(Objective-C)- No step provided
OnfidoConfigError.multipleTokenTypes
(Swift)ONFlowConfigErrorMultipleTokenTypes
(Objective-C)- Both an SDK token and a Mobile token is provided
OnfidoConfigError.applicantProvidedWithSDKToken
(Swift)ONFlowConfigErrorApplicantProvidedWithSDKToken
(Objective-C)- Both an SDK token and an applicant is provided
OnfidoConfigError.invalidDocumentFormatAndCountryCombination
(Swift)ONFlowConfigErrorInvalidDocumentFormatAndCountryCombination
(Objective-C)- Unsupported document format for the specified country provided
- See Document Type Configuration section to check supported combinations
Customizing the SDK
For a general introduction to the customization options available on the Onfido SDKs, you may wish to read our SDK customization guide on the Developer Hub.
Flow customization
The SDK's flow can be customized by removing, adding or reshuffling certain steps. For example, you could have only document capture for your flow, or have both document and selfie capture.
The information displayed on some screens can also be customized. For example, specifying the document type options for document capture.
Welcome
The welcome screen displays a summary of the capture steps the user will pass through.
You can show the welcome screen by calling configBuilder.withWelcomeStep()
in Swift or [configBuilder withWelcomeStep]
in Objective-C.
You can specify the steps to match the flow required. For example, you could have only document capture for your flow, or have both document and selfie capture.
Swift
let config = try! OnfidoConfig.builder() .withWelcomeStep() ... .build()
Objective-C
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 }
Face
In this step, a user can use the front camera to capture either a photo of their face, or a live video.
The face step has two variants for Swift interface:
FaceStepVariant.photo(with: PhotoStepConfiguration?)
FaceStepVariant.video(with: VideoStepConfiguration?)
For Objective-C interface, you should use ONFaceStepVariantConfig
as below.
A custom flow cannot contain both the photo and video variants of the face capture.
To configure with video variant:
NSError * error; Builder * variantBuilder = [ONFaceStepVariantConfig builder]; [variantBuilder withVideoCaptureWithConfig: [[VideoStepConfiguration alloc] initWithShowIntroVideo: YES]]; [configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];
To configure with photo variant:
NSError * error; Builder * variantBuilder = [ONFaceStepVariantConfig builder]; [variantBuilder withPhotoCaptureWithConfig: [[PhotoStepConfiguration alloc] initWithShowSelfieIntroScreen: YES]]]; [configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];
Swift
let config = try! OnfidoConfig.builder() .withSDKToken("YOUR_SDK_TOKEN_HERE") .withWelcomeStep() .withDocumentStep() .withFaceStep(ofVariant: .photo(withConfiguration: PhotoStepConfiguration(showSelfieIntroScreen: true))) // specify the face capture variant here .build()
Objective-C
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 } }
Document
In this step, a user can pick the type of document to capture and its issuing country before capturing it with their phone camera.
Document Type Configuration
The document step can be configured to capture single document types with a specific configuration. Each document type has its own configuration class. While configuring document type, you can optionally pass a configuration object along with type.
The supported document types are:
Document Type | Configuration Class | Configurable Properties |
---|---|---|
passport | PassportConfiguration | |
drivingLicence | DrivingLicenceConfiguration |
|
nationalIdentityCard | NationalIdentityConfiguration |
|
visa | VisaConfiguration |
|
residencePermit | ResidencePermitConfiguration |
|
workPermit | WorkPermitConfiguration |
|
generic | GenericDocumentConfiguration |
|
Generic
document type doesn't offer an optimised capture experience for a desired document type.
Configuring Country
Please refer to the ISO 3166-1 alpha-3 3-letter country codes for the country codes to pass to the SDK.
The following code shows how to capture only driving licenses from the United Kingdom:
Swift
let config = try! OnfidoConfig.builder() .withSDKToken("YOUR_SDK_TOKEN_HERE") .withDocumentStep(ofType: .drivingLicence(config: DrivingLicenceConfiguration(country: "GBR"))) .build()
Objective-C
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; [configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"]; NSError *documentVariantError = NULL; DocumentConfigBuilder * documentVariantBuilder = [ONDocumentTypeVariantConfig builder]; [documentVariantBuilder withDrivingLicenceWithConfig:[[DrivingLicenceConfiguration alloc] initWithCountry: @"GBR"]]; ONDocumentTypeVariantConfig *documentStepVariant = [variantBuilder buildAndReturnError: documentVariantError]; if (documentVariantError) { // Handle variant config error } else { NSError *configError = NULL; ONFlowConfig *config = [configBuilder buildAndReturnError:&configError]; }
Configuring Document Format
Some documents are not in card format. The SDK provides an optimised experience for some folded documents, such as the Italian national identity or French driving license.
Typically the user picks the format, but you can specify a specific format by configuring the Onfido SDK.
Card
is the default document format value for all document types.
Please check the table below to see supported document formats for each document type.
If you configure the SDK with unsupported document type/option combination, SDK will throw an OnfidoConfigError.invalidDocumentFormatAndCountryCombination
(ONFlowConfigErrorInvalidDocumentFormatAndCountryCombination
in Objective-C) error during runtime.
Document Type/ Document Format | card | folded |
---|---|---|
drivingLicence | ALL COUNTRIES | Only France (Country code "FRA") |
nationalIdentityCard | ALL COUNTRIES | Only Italy (Country code "ITA") |
Document Type/ Document Format | |
---|---|
passport | NOT CONFIGURABLE |
residencePermit | NOT CONFIGURABLE |
visa | NOT CONFIGURABLE |
workPermit | NOT CONFIGURABLE |
generic | NOT CONFIGURABLE |
The following code shows how to capture a folded national identity document from Italy:
Swift
let config = try! OnfidoConfig.builder() .withSDKToken("YOUR_SDK_TOKEN_HERE") .withDocumentStep(ofType: .nationalIdentityCard(config: NationalIdentityConfiguration(documentFormat: .folded, country: "ITA")) .build()
Objective-C
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; [configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"]; NSError *documentVariantError = NULL; DocumentConfigBuilder * documentVariantBuilder = [ONDocumentTypeVariantConfig builder]; [documentVariantBuilder withNationalIdentityCardWithConfig:[[NationalIdentityConfiguration alloc] initWithDocumentFormat:DocumentFormatFolded country: @"ITA"]]; ONDocumentTypeVariantConfig *documentStepVariant = [variantBuilder buildAndReturnError: documentVariantError]; if (documentVariantError) { // Handle variant config error } else { NSError *configError = NULL; ONFlowConfig *config = [configBuilder buildAndReturnError:&configError]; }
Enabling ePassport NFC extraction (BETA)
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 to understand how to enable itYou have to include the following code in your app target's Info.plist file to be able to read NFC tags properly
<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>
SDK Integration
Some passports contain a chip which can be accessed using Near Field Communication. The SDK provides a set of screens to extract the information contained within the chip to verify the original document is present.
This feature is currently in BETA and the API is subject to change. Changes to the API will not result in a breaking change.
Swift
let config = try! OnfidoConfig.builder() .withSDKToken("YOUR_SDK_TOKEN_HERE") .withDocumentStep() .withPassportNFCReadBetaFeatureEnabled() .build()
Objective-C
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; [configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"]; [configBuilder withWelcomeStep]; [configBuilder withDocumentStep]; [configBuilder withPassportNFCReadBetaFeatureEnabled]; NSError *configError = NULL; ONFlowConfig *config = [configBuilder buildAndReturnError:&configError];
UI customisation
In order to enhance the user experience during the transition between your application and the SDK, you can customise some of the colors and fonts used in the SDK flow.
To customise:
Swift
let appearance = Appearance( primaryColor: <DESIRED_UI_COLOR_HERE>, primaryTitleColor: <DESIRED_UI_COLOR_HERE>, primaryBackgroundPressedColor: <DESIRED_UI_COLOR_HERE>, secondaryBackgroundPressedColor: <DESIRED_UI_COLOR_HERE>, fontRegular: <DESIRED_FONT_NAME_HERE>, fontBold: <DESIRED_FONT_NAME_HERE>), supportDarkMode: <true | false>)) let configBuilder = OnfidoConfig.builder() configBuilder.withAppearance(appearance)
Objective-C
ONAppearance *appearance = [[ONAppearance alloc] initWithPrimaryColor:<DESIRED_UI_COLOR_HERE> primaryTitleColor:<DESIRED_UI_COLOR_HERE> primaryBackgroundPressedColor:<DESIRED_UI_COLOR_HERE> secondaryBackgroundPressedColor:<DESIRED_UI_COLOR_HERE> fontRegular: <DESIRED_FONT_NAME_HERE> fontBold: <DESIRED_FONT_NAME_HERE> supportDarkMode: <true | false>>]]; ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; [configBuilder withAppearance:appearance];
primaryColor
: Defines the background color of views such as document type icon and capture confirmation buttons and back navigation button.primaryTitleColor
: Defines the text color of labels included in views such as capture confirmation buttonsprimaryBackgroundPressedColor
: Defines the background color of capture confirmation buttons when pressedsecondaryBackgroundPressedColor
: Defines the background color of capture cancel buttons when pressedfontRegular
: Defines the custom font name for the regular style labelsfontBold
: Defines the custom font name for the bold style labelssupportDarkMode
: Defines if iOS Dark Mode will be supported on SDK screens. The value is true by default. This property applicable only for Xcode 11+ built apps and has effect for the users whose device is running on iOS 13 and above
Dark Mode only UI customisation
To change the supportDarkMode
value, use the initialiser below:
Swift
let appearance = Appearance(supportDarkMode: <true|false>) let configBuilder = OnfidoConfig.builder() configBuilder.withAppearance(appearance)
Objective-C
ONAppearance *appearance = [[ONAppearance alloc] initWithSupportDarkMode:<true|false>];
Localisation
Onfido iOS SDK already comes with out-of-the-box translations for the following locales:
- English (en) š¬š§
- Spanish (es) šŖšø
- French (fr) š«š·
- German (de) š©šŖ
Language customisation
The iOS SDK also allows for the selection of a specific custom language for locales that Onfido does not currently support.
This feature requires having a Localizable.strings
in your app for the desired language and by configuring the flow using withCustomLocalization()
method on the configuration builder.
When adding a custom translation, please make sure you add the whole set of keys on the Localizable.strings
file. In particular, onfido_locale
, must be included that identifies the current locale being added. The value for this string should be the ISO 639-1 2-letter language code corresponding to the translation being added.
Examples:
- when strings file added for Russian language, the
onfido_locale
key should haveru
as its value - when strings file added for American English language (en-US), the
onfido_locale
key should haveen
as its value
Without the locale string correctly translated, we won't be able to determine which language the user is likely to use when doing the video liveness challenge. This may result in an inability to correctly process the video, and the check may fail.
Note:
- if the string translations change it will result in a MINOR version change, therefore you are responsible for testing your translated layout in case you are using this feature
- if you want a language translated you can get in touch with us at ios-sdk@onfido.com
Swift
let config = try! OnfidoConfig.builder() .withSDKToken("YOUR_SDK_TOKEN_HERE") .withWelcomeStep() .withDocumentStep(ofType: .drivingLicence, andCountryCode: "GBR") .withFaceStep(ofVariant: .photo(withConfiguration: nil)) .withCustomLocalization() // will look for localizable strings in your Localizable.strings file .build()
Objective-C
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]; }
You can find the keys for the localizable strings under the localization
directory which contains strings files for all out-of-the-box translations.
You can supply partial translations, meaning if you donāt include a translation to particular key our translation will be used instead. You can also 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 i.e. withCustomLocalization(andTableName: "MY_CUSTOM_STRINGS_FILE")
([configBuilder withCustomLocalizationWithTableName:@"MY_CUSTOM_STRINGS_FILE"];
for Objective-C). Addtionally you can specify the bundle from which to read the strings file i.e withCustomLocalization(andTableName: "MY_CUSTOM_STRINGS_FILE", in: myBundle)
([configBuilder withCustomLocalizationWithTableName:@"MY_CUSTOM_STRINGS_FILE" in: myBundle];
for Objective-C).
Creating checks
The SDK is only responsible for capturing and uploading photos and videos. To create a check you will need to start the check on your backend server using the Onfido API.
1. Obtaining an API token
All API requests must be made with a valid API token included in the request headers. You can find your API token inside your Onfido Dashboard. Note: This is not a mobile token.
Refer to the authentication section in our API reference for details. For testing, you should be using a sandbox token, not a live token.
2. Creating a check
You can create a check by making a request to the 'create check' endpoint, using the applicant ID.
If you are just verifying a document, you only have to include a document report as part of the check. On the other hand, if you are verifying a document and a live photo or live video, you will also have to include a Facial Similarity report with the corresponding values: facial_similarity_photo
for the photo option and facial_similarity_video
for the video option.
$ curl https://api.onfido.com/v3/checks \ -H 'Authorization: Token token=YOUR_API_TOKEN' \ -d 'applicant_id=YOUR_APPLICANT_ID' \ -d 'report_names=[document,facial_similarity_photo]'
You can also submit the POST request in JSON format.
You will receive a response containing the check id instantly. As Document and Facial Similarity reports do not always return actual results straightaway, you can set up webhooks to get notified when the results are ready.
If you are testing in our sandbox environment, please be aware that the results are pre-determined. You can learn more about sandbox responses.
3. Setting up webhooks
Refer to the Webhooks section in the API documentation for details.
User Analytics
The SDK allows you to track the user's journey through the verification process via a definable hook. This provides insight into how your users make use of the SDK screens.
Overriding the hook
In order to expose the user's progress through the SDK a hook method must be defined while creating the OnfidoFlow.swift
instance using a .with(eventHandler: EventHandler)
call. This might look something like the following:
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:
eventName
: AString
indicating the type of event. Currently this will always return as"Screen"
as each tracked event is a user visiting a screenproperties
: ADictionary
object containing the specific details of an event. This will contain things such as thename
of the screen visited
Tracked events
Below is the list of potential events currently being tracked by the hook:
WELCOME - User reached the "Welcome" 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
Going live
Once you are happy with your integration and are ready to go live, please contact client-support@onfido.com to obtain live versions of the API token and the mobile token. You will have to replace the sandbox tokens in your code with the live tokens.
A few things to check before you go live:
- make sure you have set up webhooks to receive live events
- make sure you have entered correct billing details inside your Onfido Dashboard
Size Impact
User iOS Version | SDK Size Impact (MB) |
---|---|
12.2 and above | 4.656 |
Below 12.2 | up to 4.656* or up to 16.488** |
* If the application is in Swift but doesn't include any Swift libraries that the Onfido iOS SDK requires
** If the application doesn't include any Swift code, i.e. written completely in Objective-C, and the Onfido iOS SDK is the only
Swift library that application integrates with
Note: These calculations were performed based on a single application architecture.
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.
Security
This section is dedicated to every security aspect of the SDK.
Certificate Pinning
Certificate pinning only works on devices running on iOS 10.3 or above.
We provide integrators the ability to pin any communications between our SDK and server, through a .withCertificatePinning()
method in our OnfidoConfig.Builder
configuration builder. This method accepts as a parameter a CertificatePinningConfiguration
with sha-256 hashes of certificate's public keys.
If you are interested in using this feature, for more information about the hashes, please reach out to us at ios-sdk@onfido.com.
Swift
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
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
If you want to identify certificate pinning error from others, check the message
property of the returned OnfidoFlowError.exception
object, which should be invalid_certificate
for certificate pinning related errors.
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 } }
Licensing
Due to API-design constraints, and to avoid possible conflicts during the integration, we bundle some of our 3rd party dependencies.
We include the licensing information inside our bundle and also in our GitHub repository under license folder, in 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:
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)
Sample App
We have included sample apps to show how to integrate with the Onfido SDK using both Swift and Objective-C. Check out respectively the SampleApp
and SampleAppObjC
directories.
Support
Please open an issue through GitHub. Please be as detailed as you can. Remember not to submit your token in the issue. Also check the closed issues to see whether it has been previously raised and answered.
If you have any issues that contain sensitive information please send us an email with the ISSUE:
at the start of the subject to ios-sdk@onfido.com
Previous version 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).
Migration Guide
Onfido iOS SDK 18.10.0 Migration Guide
String Changes
Added
The following string keys have been added:
onfido_app_title_country_select_search
(en, fr, de, es)
onfido_country_select_list_accessibility
(en, fr, de, es)
Changed
The following string keys have been changed:
onfido_app_title_country_select
(en, fr, de, es)
Removed
The following string keys have been removed:
onfido_country_select_title
(en, fr, de, es)
onfido_video_confirmation_title
(en, fr, de, es)
Onfido iOS SDK 18.9.0
String Changes
Added
The following string keys have been added:
onfido_capture_confirmation_image_zoom_instructions
(en, fr, es, de)onfido_capture_confirmation_image_zoom_button
(en, fr, es, de)onfido_capture_confirmation_image_preview_button
(en, fr, es, de)onfido_generic_alert_network_error_label
(en, fr, de, es)onfido_generic_uploading
(en, fr, de, es)onfido_generic_alert_network_error_button_primary
(en, fr, de, es)onfido_info_tablet_orientation_subtitle
(en, fr, de, es)onfido_info_tablet_orientation_title
(en, fr, de, es)onfido_info_tablet_orientation_body
(en, fr, de, es)
Removed
The following string keys have been removed:
onfido_accessibility_liveness_confirmation_view
(en, fr, de, es)onfido_decline
(en, fr, de, es)onfido_label_doc_type_driving_license_up
(en, fr, de, es)onfido_label_doc_type_id_card_up
(en, fr, de, es)onfido_label_doc_type_residence_permit_up
(en, fr, de, es)onfido_message_capture_face
(en, fr, de, es)onfido_liveness_preparation_subtitle
(en, fr, de, es)onfido_error_dialog_title
(en, fr, de, es)onfido_message_uploading
(en, fr, de, es)onfido_ok
(en, fr, de, es)onfido_orientation_message_subtitile_ios
(en, fr, de, es)onfido_orientation_message_title_ios
(en, fr, de, es)onfido_orientation_upsidedown_message_ios
(en, fr, de, es)
Onfido iOS SDK 18.8.0
String Changes
Changed
ā ļø Most localisation keys now renamed. Use migrate-keys.rb script and key mapping file key_migration_18_7_0_mapping.json to migrate from 18.7.0 to 18.8.0.
To use run following command:
migrate-keys.rb --files-path <Path/To/lproj/directories> --platform ios --key-mapping-file key_migration_18_7_0_mapping.json
Onfido iOS SDK 18.7.0
ā ļø The Onfido SDK requires CoreNFC to run from 18.7.0. Since Xcode 12 there is bug where libnfshared.dylib
is missing from simulators which is required for CoreNFC to work. See stackoverflow to solve this problem.
String Changes
Added
The following string keys have been added:
onfido_nfc_option_title
(en, fr, es, de)onfido_nfc_option_subtitle
(en, fr, es, de)onfido_nfc_option_epassport_symbol
(en, fr, es, de)onfido_nfc_option_button_primary
(en, fr, es, de)onfido_nfc_option_button_secondary
(en, fr, es, de)onfido_nfc_intro_title
(en, fr, es, de)onfido_nfc_intro_subtitle
(en, fr, es, de)onfido_nfc_intro_button_primary
(en, fr, es, de)onfido_nfc_sheet_ready_intruction
(en, fr, es, de)onfido_nfc_sheet_scanning_subtitle
(en, fr, es, de)onfido_nfc_failed_title
(en, fr, es, de)onfido_nfc_failed_list_item_remove_covers
(en, fr, es, de)onfido_nfc_failed_list_item_keep_contact
(en, fr, es, de)onfido_nfc_failed_button_primary
(en, fr, es, de)onfido_nfc_failed_button_secondary
(en, fr, es, de)
Onfido iOS SDK 18.5.0
String Changes
Added
The following string keys have been added:
onfido_south_african_id_capture_title
(en, fr, es, de)
Onfido iOS SDK 18.1.0
String Changes
Added
The following string keys have been added:
onfido_selfie_intro_button
onfido_selfie_confirmation_confirm_button
onfido_selfie_confirmation_retake_button
onfido_liveness_intro_button
onfido_flow_intro_subtitle
onfido_doc_type_selection_passport_option
onfido_doc_type_selection_driving_license_option
onfido_doc_type_selection_identity_card_option
onfido_doc_type_selection_residence_permit_option
onfido_doc_type_selection_title
onfido_doc_type_selection_subtitle
onfido_selfie_capture_instructions
onfido_liveness_capture_instructions
Changed
The following string keys have been changed:
onfido_confirm_driving_license
(en)onfido_confirm_generic_document
(en)onfido_confirm_national_id
(en)onfido_confirm_passport
(en)onfido_confirm_residence_permit
(en)onfido_confirm_visa
(en)onfido_discard
(en)onfido_welcome_view_title
(en)onfido_capture_face_subtitle
(en)onfido_capture_face_step_1
(en)onfido_capture_face_step_2
(en)onfido_liveness_intro_title
(en)onfido_liveness_intro_subtitle
(en)onfido_submit_video
(en)onfido_welcome_view_toolbar_title
(en)onfido_message_check_readability_subtitle_driving_license
(en)onfido_message_check_readability_subtitle_generic
(en)onfido_message_check_readability_subtitle_national_id
(en)onfido_message_check_readability_subtitle_passport
(en)onfido_message_check_readability_subtitle_residence_permit
(en)onfido_message_check_readability_subtitle_visa
(en)onfido_message_confirm_face_subtitle
(en)
Removed
The following string keys have been removed:
onfido_confirm_face_long
onfido_discard_face_long
onfido_welcome_view_face_capture_title_ios
onfido_confirm_face_2
onfido_continue
onfido_welcome_view_time
onfido_document_selection_title
onfido_document_selection_subtitle
onfido_message_capture_face
Onfido iOS SDK 18.0.0
Breaking API Changes
- The way to configure SDK for document capture step has changed. To see instructions and usage examples please check out README page.
Onfido iOS SDK 17.0.0
Breaking API changes
The deprecated
withApplicant()
function has been removed. If you're usingwithApplicant()
function to create an applicant, please refer to README to understand how to create an applicant. Once you created it, usewithApplicantId
function to passid
value of applicant.Following with
withApplicant()
function removal,OnfidoConfigError.multipleApplicants
andONFlowResultType.applicant
enum cases have been removed.Note: This change doesn't affect the integrators who use SDK token (
withSDKToken()
) to configure the SDK as applicant creation happens before SDK token generation.
Strings
The following string keys have been added:
onfido_flow_intro_summary_photo_capture_steps
onfido_flow_intro_summary_photo_video_capture_steps
onfido_flow_intro_summary_button_document_step
onfido_capture_face_title
onfido_liveness_intro_title
onfido_liveness_challenge_turn_face_forward
onfido_message_side_document_front_driving_license_autocapture
onfido_message_side_document_back_driving_license_autocapture
The following string keys have been changed:
onfido_welcome_view_document_capture_title
onfido_welcome_view_face_capture_title
onfido_welcome_view_liveness_capture_title
onfido_mrz_not_detected_subtitle
onfido_barcode_error_title
onfido_barcode_error_subtitle
onfido_liveness_challenge_turn_right_title
onfido_liveness_challenge_turn_left_title
onfido_message_document_passport
onfido_message_passport_capture_subtitle
onfido_message_document_visa
onfido_message_visa_capture_subtitle
onfido_message_side_document_front_driving_license
onfido_message_document_capture_info_front_driving_license
onfido_message_side_document_back_driving_license
onfido_message_document_capture_info_back_driving_license
onfido_message_side_document_front_residence_permit
onfido_message_document_capture_info_front_residence_permit
onfido_message_side_document_back_residence_permit
onfido_message_document_capture_info_back_residence_permit
onfido_message_side_document_front_national_id
onfido_message_document_capture_info_front_national_id
onfido_message_side_document_back_national_id
onfido_message_document_capture_info_back_national_id
onfido_message_side_document_front_generic
onfido_message_document_capture_info_front_generic
onfido_message_side_document_back_generic
onfido_message_document_capture_info_back_generic
The following string keys have been removed:
onfido_barcode_error_third_title
Onfido iOS SDK 16.1.0
Strings
The following string keys have been added:
onfido_italian_id_capture_title
onfido_french_driving_license_capture_title
onfido_folded_paper_option
onfido_plastic_card_option
onfido_driving_license_type_selection_title
onfido_national_identity_type_selection_title
onfido_folded_paper_front_capture_title
onfido_folded_paper_front_capture_subtitle
onfido_folded_paper_back_capture_title
onfido_folded_paper_back_capture_subtitle
onfido_folded_paper_confirmation_title
onfido_upload_photo
onfido_retake_photo
Onfido iOS SDK 16.0.0
Strings
The following string keys have been added:
onfido_blur_detection_title
onfido_blur_detection_subtitle
onfido_label_doc_type_generic_up
onfido_mrz_not_detected_title
onfido_mrz_not_detected_subtitle
onfido_face_not_detected_title
onfido_face_not_detected_subtitle
onfido_face_not_detected_subtitle_folded_paper_document
Breaking API changes
New document type added:
generic
The way to configure SDK for document types has been changed for Objective-C Interface
Driving Licence (United Kingdom) document capture:
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; NSError *documentVariantError = NULL; DocumentConfigBuilder *documentVariantBuilder = [ONDocumentTypeVariantConfig builder]; [documentVariantBuilder withDrivingLicence]; ONDocumentTypeVariantConfig *documentStepVariant = [documentVariantBuilder buildAndReturnError: &documentVariantError]; [configBuilder withDocumentStepOfType:documentStepVariant andCountryCode:@"GBR"];
Generic (United Kingdom) document capture:
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; NSError *documentVariantError = NULL; DocumentConfigBuilder *documentVariantBuilder = [ONDocumentTypeVariantConfig builder]; [documentVariantBuilder withGenericWithConfig: NULL]; ONDocumentTypeVariantConfig *documentStepVariant = [documentVariantBuilder buildAndReturnError: &documentVariantError]; [configBuilder withDocumentStepOfType:documentStepVariant andCountryCode:@"GBR"];
Onfido iOS SDK 15.0.0
Changed
- Carthage json file name was changed. Please check the README for the details.
Onfido iOS SDK 14.0.0-rc
Requirements
- Xcode 11.0.0
Onfido iOS SDK 14.0.0-beta
Requirements
- Xcode 11.0.0 beta 7
- iOS 10+
Removed
- iOS 9 support
Onfido-Release
no longer supported
Onfido iOS SDK 13.2.0
Strings
The following string keys have been added:
onfido_autocapture_manual_fallback_title
onfido_autocapture_manual_fallback_description
The following string keys have been updated:
onfido_message_visa_capture_subtitle
(french only)onfido_autocapture_manual_fallback_title
(french only)onfido_autocapture_manual_fallback_description
(french only)onfido_accessibility_video_play
(french only)
The following string keys have been removed:
onfido_autocapture_info
onfido_press_button_capture
onfido_submit_my_picture
Onfido iOS SDK 13.1.0
Removed
withUSDLAutocapture
method on OnfidoConfig.- this was an experimental feature and is not considered a breaking api change
- US driving license autocapture is now default feature when user selects Driving License as document and United States as country.
Strings
The following string values for keys have been changed:
onfido_label_doc_type_driving_license_up
(english)onfido_message_document_passport
(english)onfido_glare_detected_title
(english)onfido_liveness_challenge_turn_left_title
(english)onfido_liveness_challenge_turn_right_title
(english)onfido_liveness_fetch_challenge_error_title
(english)onfido_welcome_view_face_capture_title
(spanish)onfido_liveness_preparation_subtitle
(spanish)onfido_message_document_passport
(spanish)onfido_message_side_document_front_driving_license
(spanish)onfido_message_document_capture_info_front_driving_license
(spanish)onfido_message_side_document_back_driving_license
(spanish)onfido_message_document_capture_info_back_driving_license
(spanish)onfido_message_side_document_front_residence_permit
(spanish)onfido_message_document_capture_info_front_residence_permit
(spanish)onfido_message_side_document_back_residence_permit
(spanish)onfido_message_document_capture_info_back_residence_permit
(spanish)onfido_message_side_document_front_national_id
(spanish)onfido_message_document_capture_info_front_national_id
(spanish)onfido_message_side_document_back_national_id
(spanish)onfido_message_document_capture_info_back_national_id
(spanish)onfido_message_side_document_front_generic
(spanish)onfido_message_document_capture_info_front_generic
(spanish)onfido_message_document_capture_info_back_generic
(spanish)onfido_message_check_readability_subtitle_passport
(spanish)onfido_message_check_readability_subtitle_residence_permit
(spanish)onfido_message_check_readability_subtitle_driving_license
(spanish)onfido_message_check_readability_subtitle_national_id
(spanish)onfido_message_check_readability_subtitle_visa
(spanish)onfido_message_check_readability_subtitle_generic
(spanish)onfido_confirm_national_id
(spanish)onfido_confirm_face_2
(spanish)onfido_no_face
(spanish)onfido_message_validation_error_face
(spanish)onfido_multiple_faces
(spanish)onfido_message_validation_error_multiple_faces
(spanish)onfido_liveness_preparation_subtitle
(spanish)onfido_liveness_timeout_exceeded_title
(spanish)onfido_retake_video
(spanish)onfido_discard
(spanish)onfido_decline
(spanish)
Onfido iOS SDK 13.0.0
Breaking API changes
- Introduced two new enum case for OnfidoConfigError:
- OnfidoConfigError.multipleTokenTypes (ONFlowConfigErrorMultipleTokenTypes for Objective-C): This error will be thrown when both an SDK Token and a Mobile Tokens are provided.
- OnfidoConfigError.applicantProvidedWithSDKToken (ONFlowConfigErrorApplicantProvidedWithSDKToken for Objective-C): This error will be thrown when both an SDK Token and an applicant provided.
Onfido iOS SDK 12.1.0
Strings
The following string keys have been added:
onfido_liveness_fetch_challenge_error_title
onfido_liveness_fetch_challenge_error_description
onfido_liveness_fetch_challenge_error_button_title
The following string keys have been removed:
onfido_liveness_challenge_open_mouth_title
Onfido iOS SDK 12.0.0
Breaking API changes
- Face capture with photo variant:
let configBuilder = OnfidoConfig.builder() ... configBuilder.withFaceStep(ofVariant: .photo(with: nil))
- Face capture with video variant (showing liveness intro video):
let configBuilder = OnfidoConfig.builder() ... configBuilder.withFaceStep(ofVariant: .video(with: nil))
or
let configBuilder = OnfidoConfig.builder() ... configBuilder.withFaceStep(ofVariant: .video(with: VideoStepConfiguration(showIntroVideo: true)))
- Face capture with video variant (not showing liveness intro video):
let configBuilder = OnfidoConfig.builder() ... configBuilder.withFaceStep(ofVariant: .video(with: VideoStepConfiguration(showIntroVideo: false)))
Objective-C Interface
- Face capture with photo variant:
NSError * error = NULL; ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; ... Builder * variantBuilder = [ONFaceStepVariantConfig builder]; [variantBuilder withPhotoCaptureWithConfig: NULL]; [configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];
- Face capture with video variant:
NSError * error = NULL; ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; ... Builder * variantBuilder = [ONFaceStepVariantConfig builder]; [variantBuilder withVideoCaptureWithConfig: NULL]; [configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];
or
NSError * error = NULL; ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder]; ... Builder * variantBuilder = [ONFaceStepVariantConfig builder]; [variantBuilder withVideoCaptureWithConfig: NULL]; [configBuilder withFaceStepOfVariant: [variantBuilder buildAndReturnError: &error]];
Onfido iOS SDK 11.1.2
Strings
The following string keys have been removed:
onfido_back
onfido_next_step
The following string keys have been added:
onfido_accessibility_liveness_intro_video_pause
onfido_accessibility_liveness_intro_video_play
Onfido iOS SDK 11.1.0
Deprecated
Onfido-Release
framework is deprecated and will be removed in a future version of the Onfido SDK.
If using Cocoapods change Podfile
from:
pod 'Onfido', :configurations => ['Debug'] pod 'Onfido-Release', :configurations => ['Release']
to:
pod 'Onfido'
For manual installation add a Run Script Phase to your app Build Phases
after Embed Frameworks
step with the following code:
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
Strings
The following string keys have been removed:
onfido_back
onfido_next_step
Onfido iOS SDK 11.0.0
Requirements
- Xcode 10.2
Strings
The following string keys have been added:
onfido_wrong_side
onfido_device_permission_title_both
onfido_device_permission_subtitle_both
onfido_device_permission_instructions_both
onfido_device_permission_btn_title_both
onfido_device_permission_title_camera
onfido_device_permission_subtitle_camera
onfido_device_permission_instructions_camera
onfido_device_permission_btn_title_camera
onfido_device_permission_title_mic
onfido_device_permission_subtitle_mic
onfido_device_permission_instructions_mic
onfido_device_permission_btn_title_mic
onfido_message_uploading
onfido_label_doc_type_work_permit_up
onfido_message_side_document_front_generic
onfido_message_document_capture_info_front_generic
onfido_message_side_document_back_generic
onfido_message_document_capture_info_back_generic
onfido_message_check_readability_subtitle_work_permit
onfido_confirm_generic_document
Onfido iOS SDK 10.6.0
Onfido iOS SDK 10.5.0
Strings
The following string keys have been added:
onfido_start
onfido_welcome_view_title
onfido_welcome_view_time
onfido_welcome_view_document_capture_title
onfido_welcome_view_face_capture_title
onfido_welcome_view_liveness_capture_title
onfido_capture_face_subtitle
onfido_capture_face_step_1
onfido_capture_face_step_2
The following string keys have been changed:
onfido_country_selection_toolbar_title
onfido_unsupported_document_description
The following string keys have been removed:
onfido_liveness_challenge_next
onfido_liveness_challenge_stop
onfido_liveness_challenge_recording
Onfido iOS SDK 10.4.0
Strings
The following string keys have been added:
onfido_liveness_intro_subtitle
onfido_reload
onfido_unable_load_unstable_network
onfido_liveness_intro_step_1_title
onfido_liveness_intro_step_2_title
onfido_welcome_view_liveness_capture_title
onfido_liveness_intro_loading_video
The following string keys have been removed:
onfido_liveness_intro_title
onfido_liveness_intro_fourth_subtitle
Onfido iOS SDK 10.3.0
Onfido iOS SDK 10.2.0
Strings
The following string keys have been added:
onfido_accessibility_camera_capture_shutter
onfido_accessibility_liveness_start_record
onfido_accessibility_liveness_end_record
onfido_accessibility_liveness_next_challenge
onfido_label_doc_type_visa_up
onfido_message_document_visa
onfido_message_visa_capture_subtitle
onfido_message_check_readability_subtitle_visa
onfido_confirm_visa
Onfido iOS SDK 10.1.0
Onfido iOS SDK 10.0.0
Requirements
- Xcode 10.0
- Swift 3.4 or Swift 4.2
Strings removed:
onfido_privacy_policy_title
onfido_privacy_policy_position_doc
onfido_privacy_policy_avoid_light
onfido_privacy_policy_terms_extended
onfido_start
Onfido SDK 9.0.0
Results objects
In version 9.0.0 we have brought some changes to the api response object (appended with Result
).
ApplicantResult
'sid
,href
,firstName
andlastName
properties are no longer optional.FaceResults
'sid
,href
andcreatedAt
(renamedcreated_at
) properties are no longer optional.- Results properties now camel-cased instead of snake-cased.
- Results objects, except those preappended with
ON
, no longer inherit fromNSObject
.
Simulator support
Version 9.0.0 now supports running the SDK on the simulator for which the integrator has no longer to handle OnfidoFlowError.deviceHasNoCamera
, which is the reason that it has been deleted.
Strings
With this release we have brought a breaking change only for customised languages integrators.
The following string keys has been removed:
onfido_message_check_readability_title
onfido_message_confirm_face_title
Onfido SDK 8.0.0
Deployment target
Version 8.0.0 raises the minimum iOS version from 8.0 to 9.0. If you are still using version iOS 8.0 then you must now check if the running iOS version is at least 9.0 before invoking Onfido SDK. You can do it using the following:
if #available(iOS 9.0, *) { // call onfido here } else { // can't verify user }
Alternatively you can use a guard
:
guard #available(iOS 9.0, *) else { // can't verify user }
Flow dismissal
With this release we have brought a breaking change for all integrations. The default behaviour now is upon completion of the flow (user cancels, error occurs or user goes through the whole flow), the flow will dismiss itself. You can still maintain previous behaviour and dismiss the flow at your convenience by setting dismissFlowOnCompletion
argument to false on the method call with(responseHandler: _, shouldDismissFlowOnCompletion: _)
. For example:
Swift
OnfidoFlow(withConfiguration: config) .with(responseHandler: { /* handle response */ }, dismissFlowOnCompletion: false) .run()
Objective-C
ONFlow *onFlow = [[ONFlow alloc] initWithFlowConfiguration:config]; void (^responseHandler)(ONFlowResponse *response) = ^(ONFlowResponse *response) { // handle response }; [onFlow withResponseHandler:responseHandler dismissFlowOnCompletion:false];
Strings
The following string keys have been removed:
onfido_document_selection_cancel
The following string keys have been added:
onfido_locale
Onfido SDK 7.2.0
With this release we have brought a breaking change only for customised languages integrators.
The following string keys has been added:
"onfido_barcode_error_title"
"onfido_barcode_error_subtitle"
"onfido_barcode_error_third_title"
"onfido_error_dialog_title"
"onfido_error_connection_message"
"onfido_suggested_country"
"onfido_all_countries"
"onfido_country_selection_toolbar_title"
"onfido_unsupported_document_title"
"onfido_unsupported_document_description"
"onfido_select_another_document"
"onfido_close"
Onfido SDK 7.1.0
With this release we have brought a breaking change only for customised languages integrators.
We have added the following string keys:
"onfido_document_selection_title"
"onfido_document_selection_subtitle"
We have removed the following string keys:
"onfido_document_selection_message"
Onfido SDK 7.0.0
With this release we have brought a breaking change only for customised languages integrators.
Note: The string custom translation version scheme has changed, going forward 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.
We have added the following string keys:
"onfido_no_document"
"onfido_no_face"
"onfido_multiple_faces"
"onfido_message_validation_error_document"
"onfido_message_validation_error_face"
We have removed the following string keys:
"onfido_no_document_error_message"
"onfido_message_validation_error_no_face"
Please update your custom languages accordingly. Otherwise the language will fallback to English by default.
Onfido SDK 6.0.0
This version is mainly an upgrade to the compiled SDK form. In order to use this version check out the requirements below.
Requirements
- Xcode 9.3
- Swift 3.3 or Swift 4.1
Breaking API changes
There are no breaking api changes in terms of coding.
Onfido SDK 5.6.0
With this release we have brought minor memory management improvements to the Objective-C integrator. You are no longer required to hold a strong reference to ONFlow
instance during the flow execution.
Onfido SDK 5.5.0
While this is a minor release there are memory management improvements which means it's no longer necessary to keep a strong reference to OnfidoFlow
for the swift interface (objective C interface still needs it). This means you can create the object, use it and not have to keep it as a property.
Onfido SDK 5.1.0
While this is a minor release and there are no breaking changes we have deprecated parts of the API.
Applicants
We have deprecated OnfidoConfig.builder().withApplicant(applicant)
in favour of OnfidoConfig.builder().withApplicantId(applicantId)
. We now recommend that you create an Onfido applicant yourself on your backend and pass the applicant ID to the SDK. Similarly the applicantResult object in the responseHandler
is also deprecated. Both withApplicant
and applicantResult
will continue to work as before, but will be removed in the next major release of the SDK.
Onfido SDK 5.0.0
This version is mainly an upgrade to the compiled SDK form. In order to use this version check out the requirements below.
Requirements
- Xcode 9.1
- Swift 3.2.2 or Swift 4.0.2
Breaking API changes
There are no breaking api changes in terms of coding.
Onfido SDK 4.0.0
This version has some major changes that include a full refactor of the API (breaking) with which you can integrate more easily and use our latest face video capture feature.
Requirements
- Xcode 9.0+
- iOS 8+
- Swift 3.2 or Swift 4
Benefits of upgrading
- Easier to integrate with API
- New face video capture feature
Breaking API Changes
The SDK now does not allow to be used as a capture only tool. Upload and validation of capture is now mandatory. The option to disable analytics has also been removed.
Configuring and Running SDK
We have been given feedback that API could be easier to integrate with. We have learnt from our customers how they use the SDK and applied that knowledge, together with the lessons learned, in order to provide better experience and cut down on the SDK integration time.
The code below compares a simple configuration of document and face capture with upload to the Onfido API.
Note: Capture only configurations are no longer supported
// Onfido iOS SDK 3 let applicant = Applicant.new( firstName: "Theresa", lastName: "May" ) let onfidoFlow = OnfidoFlow(apiToken: "YOUR_MOBILE_TOKEN", allowAnalytics: false) .and(capture: [.document, .livePhoto]) .and(create: [.applicant(applicant), .document(validate:true), .livePhoto]) .and(handleResponseWith: { results in // Callback when flow ends }) // Onfido iOS SDK 4.0.0 let applicant = Applicant.new( firstName: "Theresa", lastName: "May" ) /** Note: option to disable analytics no longer supported */ let config = try! OnfidoConfig.builder() .withToken("YOUR_TOKEN_HERE") .withApplicant(applicant) .withDocumentStep() .withFaceStep(ofVariant: .photo) .build() let onfidoFlow = OnfidoFlow(withConfiguration: config) .with(responseHandler: { results in // Callback when flow ends })
The document step capture with a pre-selected document type with country has also changed in the new API.
// Onfido iOS SDK 3 let applicant = Applicant.new( firstName: "Theresa", lastName: "May" ) let onfidoFlow = OnfidoFlow(apiToken: "YOUR_MOBILE_TOKEN") .and(capture: [.documentWith(documentType: .drivingLicence, countryCode: "GBR"), .livePhoto]) // .documentWith(documentType: _, countryCode: _) as capture option for document type pre-selection .and(create: [.applicant(applicant), .document(validate:true), .livePhoto]) .and(handleResponseWith: { results in // Callback when flow ends }) // Onfido iOS SDK 4.0.0 let applicant = Applicant.new( firstName: "Theresa", lastName: "May" ) let config = try! OnfidoConfig.builder() .withToken("YOUR_TOKEN_HERE") .withApplicant(applicant) .withDocumentStep(ofType: .drivingLicence, andCountryCode: "GBR") // document type step with pre-selection .withFaceStep(ofVariant: .photo) .build() let onfidoFlow = OnfidoFlow(withConfiguration: config) .with(responseHandler: { results in // Callback when flow ends })
Success handling
We have changed the way document results are handled and removed the capture image by the user.
// Onfido iOS SDK 3 let document: Optional<OnfidoResult> = results.filter({ result in if case OnfidoResult.document = result { return true } return false }).first if let documentUnwrapped = document, case OnfidoResult.document(validationResult: let documentResponse, data: let documentData) = documentUnwrapped { print(documentResponse.id) let image = UIImage(data: documentData) } // Onfido iOS SDK 4.0.0 let document: Optional<OnfidoResult> = results.filter({ result in if case OnfidoResult.document = result { return true } return false }).first if let documentUnwrapped = document, case OnfidoResult.document(let documentResponse) = documentUnwrapped { print(documentResponse.description) // you can now find the image capture by accessing the following field: let imageUrl = documentResponse.href }
We have changed livePhoto
similarly to document
(no capture returned), but additionally OnfidoResult.livePhoto
has been renamed to OnfidoResult.face
. The renamed enum value now takes a payload of FaceResult
instead of LivePhotoResult
, which also includes the result from video upload in the case where the face step specifies .video
variant whilst configuring the SDK (pre-run).
// Onfido iOS SDK 3 let livePhoto: Optional<LivePhotoResult> = results.filter({ result in if case OnfidoResult.livePhoto = result { return true } return false }).first if let livePhotoUnwrapped = livePhoto, case OnfidoResult.livePhoto(validationResult: let documentResponse, data: let livePhotoData) = documentUnwrapped { print(livePhoto.id) let image = UIImage(data: livePhotoData) } // Onfido iOS SDK 4.0.0 let faceResult: Optional<FaceResult> = results.filter({ result in if case OnfidoResult.face = result { return true } return false }).first if let faceUnwrapped = face, case OnfidoResult.face(let documentResponse, data: let faceResult) = faceUnwrapped { print(livePhoto.description) let imageUrl = livePhoto.href }
Permissions
You will be required to have the NSCameraUsageDescription
and NSMicrophoneUsageDescription
keys in your application's Info.plist
file:
<key>NSCameraUsageDescription</key> <string>Required for document and facial capture</string> <key>NSMicrophoneUsageDescription</key> <string>Required for video capture</string>
Note: Both keys will be required for app submission.
Error handling
We have simplified errors that are returned by our API and denested them. We have gone away from domain based errors to higher level errors i.e.: OnfidoFlowError.document(DocumentError.upload(OnfidoApiError))
and OnfidoFlowError.applicant(ApplicantError.upload(OnfidoApiError))
have now been merged and simplified into OnfidoFlowError.upload(OnfidoApiError)
.
Onfido SDK 3.0.0
This version is mainly an upgrade to the compiled SDK form. In order to use this version check out the requirements below.
Requirements
- Xcode 9
- Swift 3.2 or Swift 4
Breaking API changes
There are no breaking api changes in terms of coding.
New Features
Added new document type support
The user can now select Resident Permit Card
in the document type selection action sheet.
Furthermore DocumentType.residencePermit
can now be added as the first parameter of CaptureOption.documentWith(documentType: _, countryCode: _)
. This will no longer prompt the user to select the document type that they wish to submit but rather will be expected to upload a Resident Permit Card.
Improved UI
The SDK is now continuously evaluating if document on live camera stream has glare and notifies the user with text on bubble when detected.
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
[18.10.1] - 2020-11-26
Fixed
- Public: Fixed certificate pinning bug which causes all network requests fail with
invalid_certificate
error message whenwithCertificatePinning
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
- Public: Updated readme to mention
NFCReaderUsageDescription
key in app permission section - UI: Updated video capture confirmation
- Public: Now sharing .strings files for all suported languages
Fixed
- UI: Fixed capture confirmation error bubble not being read by VoiceOver as the first view
[18.9.0] - 2020-10-27
Added
- Public: 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
- Public: 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
- Public: Removed unused strings from localisation
- Public: Renamed some generic keys
- UI: Changed bubble view position and apperance for document capture flow
- Public: Now disabling passport autocapture on simulators
Fixed
- UI: Now showing wrong side head turn warning again
- UI: Fixed the incorrect captured document positon 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
- Public: Renamed most localisation keys. Now names are more explicit to in which screens they are used. See MIGRATION to easily migrate Strings from 18.7.0 to 18.8.0.
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
- Public: Post capture confirmation error bubble on modals now grows to button width
- Public: 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
- Public: 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
- Public: Added configuration option to enable manual liveness capture
[18.3.3] - 2020-08-17
Fixed
- Public: Fixed bundle localisation issue. Related Github issue
[18.3.2] - 2020-08-06
Changed
- UI: Removed Singapore endonym
Fixed
- UI: Fix the problem about having buttons in different height. Github Issue
- Public: Fixed localisation language selection when app and device preferred language is not supported by Bundle
[18.3.1] - 2020-07-27
Fixed
- Public: Fix for sending duplicate VIDEO_FACIAL_CAPTURE_CONFIRMATION analytic event.Related github issue
- Public: 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
- Public: Removed unnnecessary
advertisingIdentifier
usage
Fixed
- Public: Fixed folded paper documents confirmation showing warning and instructions texts when returning from following step
[18.2.0] - 2020-06-17
Added
- Public: 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
- Public: Added eventHandler and corresponding event method to ONFlow.swift for User Analytic Events
- UI: Improved US Driver License edge detection
- Public: Sending barcode detection result to the API
Fixed
- Public: Fixed the face similarity report documentation url in README.
[18.1.1] - 2020-06-03
Changed
- Public: Updated SampleApps to clarify modalPresentationStyle setting
Fixed
- Public: Fixed SDK crash when invalid SDK token provided
- Public: 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
- Public: Added enterprise feature 'hideOnfidoLogo
Changed
- UI: Updated Onfido logo
- Public: Now voice over read upload alert view element when uploading image or video
- Public: 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
- Public: Added German as supported language
- Public: Added document format option for document capture step. Also changed the way to configure document capture step. Please check README for the details
- Public: 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
- Public: 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
- Public: Added certificate pinning support. See https://github.com/onfido/onfido-ios-sdk#certificate-pinning for the details.
Changed
- UI: Now using grey Onfido logo with higher contrast for accessibility
- Public: 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
- Public: Updated bubble view design and updated barcode not readable copy
- Public: 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
- Public: Updated code snippets and descriptions about API v2 with API v3 in README.
- UI: Selfie oval now same as liveness oval size
- Public: Updated README to include bitcode support information
- UI: Updated flow intro screen user interface
- Public: Updated mrz not detected error copy
- Public: 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
- Public: 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
- Public: 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
- Public: Now changing document capture frame ratio for folded paper documents and showing document template for 4 seconds
- Public: Now showing passport template when user selects passport capture
Changed
- UI: Changed voiceover message when it focuses on the liveness intro video
Fixed
- Public: 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
- Public: 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
- Public: 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
- Public: Updated README to explain how to obtain sandbox token
- Public: Changed carthage spec json file name. Please check the README for the details.
- Public: Now captured images include EXIF meta data.
[14.0.0] - 2019-10-07
Added
- Public: 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
- Public: Fixed Segment SDK crash issues, upgraded Segment SDK version to 3.7.0
[14.0.0-rc] - 2019-09-12
Added
- Public: 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
- Public: Added ability to refresh SDK token when its expired
- UI: Added dark mode support for iOS 13. See the https://github.com/onfido/onfido-ios-sdk#ui-customisation page for the details.
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
- Public: 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
- Public: 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
- Public: Added United States' driver's license autocapture as an experimental feature. Can be enabled by calling withUSDLAutocapture() in the OnfidoConfig.builder()
- Public: 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
- Public: Removed unnecessary string keys
- Public: 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
- Public: Fixed full bitcode not included in universal Onfido framework (named
Onfido-Debug
or justOnfido
)
[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
- Public: fixed debug SDK not compiling for simulators
- Public: 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
- Public: Allowing custom localisation from non-localised strings file
Fixed
- UI: Fixed crash when capture and retake buttons tapped continuously
- Public: 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
- Public: 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
andonfido_unsupported_document_description
) - Public: 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
- Public: Fixed cut-off issue on document images captured on certain iPads
- Public: Fix for the intermittent video cut-off issue when liveness capture recorded on certain iPads
- Public: Removed unused assets
[10.4.0] - 2019-02-07
Added
- Public: 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
- Public: 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
- Public: 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:
- Public: Build status on readme not rendering
- Public: Xcode warnings on missing headers
Removed:
- Public: Swinject from external dependency list
- Public: No longer using ZSWTappableLabel and ZSWTaggedString dependencies
[9.0.0] - 2018-09-03
Added
- Public: ability to run SDK on simulator
Removed
- Public: 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
- Public: 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
- Public: 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
- Public: 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
- Public: Removed Alamofire dependency
- Public: 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
- Public: 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
- Public: SDK built using Swift 4.1 and Xcode 9.3
[5.6.0] - 2018-03-16
Added
- Public: Added custom language localisation option using
withCustomLocalization()
method when configuring the flow - UI: Added translation for Spanish (es)
Changed
- Public: 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
- Public: Objective-C interface allows document type to be specified as part of the document step configuration
Changed
- Public: Swift integrator no longer has to hold a strong reference to
OnfidoFlow
instance during flow execution (Objective-C integrator should still hold the strong reference)
[5.4.1] - 2018-02-21
Fixed
- UI: Fixed two crashes related to the capture screen (by tapping cancel in the document selection and by tapping the capture button before the capture screen shows up)
[5.4.0] - 2018-02-12
Added
- UI: Video face capture screens adapted for
formSheet
presentation style
Fixed
- UI: Fixed app crash or showing confirmation screen when exiting app during face video recording
[5.3.0] - 2018-02-02
Added
- Public: Added Objective-C interface
Changed
- Internal: Reduced live video maximum duration from 25s to 20s
Fixed
- UI: Fixed crash when going back from live video intro screen to document selection
[5.2.0] - 2018-01-17
Added
- UI: Added manual focus on document capture. It's now possible to trigger by tapping on document within rectangle
Changed
- UI: Refreshed face capture experience
- Internal: Using XCAssets for bundling images in the framework instead of separate bundle
Fixed
- UI: Fixed large back button issue on iPhone X
- UI: Fixed face capture oval height ratio on iPhone X
- Internal: Fixed issue with not cleaning up uploaded images and videos from device
- Internal: Fixed issue with different video codecs being used for video capture
- Internal: Fixed document photo resolution in order to reduce data usage
[5.1.0] - 2017-11-27
Deprecated
- Public: Deprecated
withApplicant
method andapplicantResult
object.
Added
- Public: Added
withApplicantId
method as a preferred way to start a flow with previously created applicant
Changed
- UI: Refreshed face capture confirmation screen
Fixed
- UI: The document frame aspect ratio, in both capture and confirmation screen, on iPhone X is now consistent with ther other models.
[5.0.2] - 2017-11-15
Removed
- Internal: Removed ObjectMapper and AlamofireObjectMapper from podspec
[5.0.1] - 2017-11-09
Changed
- Internal: Improved glare detection algorithm
- Internal: Fixed issue on lower end devices sending low resolution images of document to the Onfido API
[5.0.0] - 2017-11-06
Note:
- This version is not backwards-compatible. Migration notes can be found in MIGRATION.md
Changed
- Public: Now support only supporting Swift 3.2.2 and Swift 4.0.2. Removed support for Swift 3.2 and 4.
[4.0.1] - 2017-10-25
Changed
- Internal: Cropping of document picture is now less agressive and done with higher precision.
[4.0.0] - 2017-10-09
Note:
- This version is not backwards-compatible. Migration notes can be found in MIGRATION.md
Added
- UI: New video face capture screen/step
- Public: Added video variant to the face step, which allows to capture face during live video recording
Changed
- Public: Simplified API configuration for easier integration,
create
andcapture
options have been merged into steps which do both - Public: Simplified API errors. Got rid of errors nesting
Removed
- Public: Success results are no longer returned for captured images
- Public: Removed ability to disable analytics
[3.0.0] - 2017-09-15
Note:
- This version is not backwards-compatible. Migration notes can be found in MIGRATION.md
- This version supports Swift 3.2 and Swift 4 but we have not tested it fully against iOS 11 yet, therefore we cannot guarantee that all features will work properly on that operating system
Added
- UI: Added support for Resident Permit as a new document type
- UI: On document capture screen, a bubble notification will be displayed in real-time if glare is detected on a document
Changed
- Public: Now supporting only Swift 3.2 and Swift 4. Removed support for Swift 3.1
[2.2.0] - 2017-08-14
Added
- UI: Rotation instructions on iPads
Changed
- UI: Improved document capture experience
- Internal: Improved metrics
[2.1.3] - 2017-06-19
Fixed
- Downgraded Alamofire version to 4.4 as 4.5 was generating a new error which will be investigated
[2.1.2] - 2017-06-06
Added
- New image quality filter (notifies user upon glare detection)
[2.1.1] - 2017-05-17
Changed
- Bug fix:
- Resolved message label issue on smaller screens being cut off
Added
- Ability to preselect document type accepted for document capture screen (skips document type selection)
[2.0.3] - 2017-04-05
- Bug fix:
- Resolved framework binary incompatibility issue for integrators using Swift 3.1
[2.0.2] - 2017-03-29
- Stability improvements
- Bug fixes:
- Fixed crash on simulator due to missing camera. Throws OnfidoFlowError.deviceHasNoCamera.
- Minor UI improvements.
[2.0.1] - 2017-03-16
Changed
- Manages camera permission and throws permission error when denied.
- Throws error when SDK configuration is missing applicant object.
[1.2.0] - 2016-12-15
Changed
- Onfido SDK now supports modally presented with form sheet style for iPads
- Fixed issue with Applicant creation process with incorrect date of birth
- Fixed issue with ApplicantResult with nil date of birth when should be present.
- Improvements to reduce and avoid memory leaks
[0.0.10] - 2016-12-15
Changed
- Bug fix for iPhones > 5s incorrect capture and crash upon image selection on capture screens
[0.0.8] - 2016-12-14
Added
- Support for different document types. For Driving Licenses and National ID cards the reverse of the document is required. The front of the document is validated by our server to make sure a readable document is present.
Changed
- Swift version used is now 3.0
- iOS supported version is 8.0 and above
[0.0.6] - 2016-10-25
Removed
- Applicant details capture view
- Dependency on MICountryPicker
Changed
- Updated syntax to Swift 2.3 (preparing to Swift 3.0)
- Updated version of AlamofireObjectMapper to 3.0.2
- The OnfidoUI class initialisation methods (refer to the README file)
Added
- Option to bring the capture UI without actually creating anything on the Onfido servers
- The applicant details are now passed as a Hash if the client wants the library to create it
- The SDK will return the LivePhoto or Document (including the captured files) when calling the callback closure of the host app - making it possible to use the capture UI without creating the files on the Onfido server, grabbing them and uploading later on
- OnfidoSDKResults class which will encapsulate the return values (Applicant, LivePhoto, Document or Check) to the host app's callback closure
- A "validate" parameter has been added to the OnfidoAPI.uploadDocument() method (refer to the Readme file)
[0.0.5] - 2016-07-28
Added
- Callbacks to the Document/Facial captures
- Mapping between alpha2 and alpha3 ISO3166-1 codes
Changed
- Improved the UI, specially in the "Next" buttons and the applicant details form
- Fixed the country code being sent to the API (it takes ISO3166-1 alpha3)
- Improved the way the binary framework is built and made it easier to ship new versions
[0.0.3-pre] - 2016-07-20
Added
- Initial public release (preview)