Android SDK

8.0.0
  • SDK 8
  • 8.0.0
  • SDK 7
  • 7.4.0
  • 7.3.0
  • 7.2.0

Getting Started

Overview

Onfido's Android input-capture SDK provides a drop-in set of screens and tools for Android applications. These allow your app to capture identity documents, live photos and live videos for identity verification. The Android 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 requirement 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.

Various views from the SDK

Various views from the SDK

The Android SDK supports API level 21 and above (distribution stats).

Version 7.4.0 was the last version that supports API level 16 and above.

Our configuration is currently set to the following:

  • minSdkVersion = 21
  • compileSdkVersion = 28
  • targetSdkVersion = 28
  • android.useAndroidX=true
  • Kotlin = 1.3+

1. Obtaining an API token

In order to start integrating, you will need an API token. You can use our sandbox environment to test your integration. You can create sandbox tokens inside your Onfido Dashboard.

Regions

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

2. Adding the SDK dependency

Starting on version 4.2.0, we now offer a modularised SDK, which means you can integrate it in two different ways:

  1. onfido-capture-sdk
  2. onfido-capture-sdk-core

1. onfido-capture-sdk

This is a complete, input quality-focused solution suited for better captures and faster IDV flows. This version provides advanced on-device, real-time glare and blur detection as well as auto-capture (passport only) on top of a set of basic image validations.

This is the recommended integration option.

gradle
Copy
repositories {
  jcenter()
}

dependencies {
  implementation 'com.onfido.sdk.capture:onfido-capture-sdk:+'
}

Due to the advanced validation support stated above, in the form of C++ code, we recommend that the integrator app performs multi-APK split to optimise the app size for individual architectures.

Multi-APK split

C++ code needs to be compiled for each of the CPU architectures (known as "ABIs") present on the Android environment. Currently, the SDK supports the following ABIs:

  • armeabi-v7a: Version 7 or higher of the ARM processor. Most recent Android phones use this
  • arm64-v8a: 64-bit ARM processors. Found on new generation devices
  • x86: Most tablets and emulators
  • x86_64: Used by 64-bit tablets

The SDK binary contains a copy of the native .so file for each of these four platforms. You can considerably reduce the size of your .apk by applying APK split by ABI, editing your build.gradle as the following:

gradle
Copy
android {

  splits {
    abi {
        enable true
        reset()
        include 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a'
        universalApk false
    }
  }
}

Further information can be found in the Android documentation.

Average size (with Proguard enabled):

ABISize
armeabi-v7a6.30 Mb
arm64-v8a7.33 Mb

2. onfido-capture-sdk-core

This is a lighter, app size-friendly version. This version provides a set of basic image validations mostly provided by the backend. Since there are no real-time validations on-device, ABI split is not needed.

gradle
Copy
repositories {
  jcenter()
}

dependencies {
  implementation 'com.onfido.sdk.capture:onfido-capture-sdk-core:+'
}

Average size (with Proguard enabled):

ABISize
universal3.84 Mb

The sizes stated above were measured by building the minimum possible wrappers around our SDK, using the following stack. Different versions of dependencies such as Gradle or NDK may result in slightly different values.

Notes:

Until these packages get approved to be included in JCenter, the following snippet must be used to instruct gradle to search for them on Bintray:

gradle
Copy
repositories {
  maven {
    url  "https://dl.bintray.com/onfido/maven"
  }
}

In order to improve the security of our clients, we upgraded our infrastructure and SDK client SSL configurations to support TLSv1.2 only. According to the relevant Google documentation, this support comes enabled by default on every device running Android API 20+.

In case you need to support devices older than that in your integration with the Onfido Android SDK, we need to access Google Play Services to install the latest security updates, which enable this support. As such, if you don't use Google Play Services on your integration yet, we require you to add the following dependency:

gradle
Copy
compile ('com.google.android.gms:play-services-base:x.y.z') {
           exclude group: 'com.android.support' // to avoid conflicts with your current support library
}

3. Creating an applicant

You can create an applicant from your backend server, using a valid API token.

At a minimum for Document and Facial Similarity reports, you must specify the applicant's first and last names in the body of the request.

shell
Copy
$ 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 has an id field containing a UUID (universally unique identifier) that identifies the applicant. Once you pass the applicant ID to the SDK documents, live photos and live videos uploaded by that instance of the SDK will be associated with that applicant.

4. 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, using the applicant ID you created in the previous step and your unique application ID.

If you're using an SDK token, you shouldn't call withApplicantId function.

Copy
$ 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_ID'
ParameterNotes
applicant_id (required)Specifies the applicant for the SDK instance
application_id (required)Your application ID

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 tokenExpirationHandler parameter. If configured it will be called when an SDK token expires and you can use it to pass a new one.

If you want to use tokenExpirationHandler you should pass a concrete class instance, you should not pass an anonymous or activity class instance.

Example Usage
Kotlin
kotlin
Copy

class ExpirationHandler : TokenExpirationHandler {

        override fun refreshToken(injectNewToken: (String?) -> Unit) {
            TODO("Your network request logic to retrieve SDK token goes here")
            injectNewToken("NEW_SDK_TOKEN") // if you pass `null` sdk exit with token expired error
        }
    }

val config = OnfidoConfig.builder(context)
    .withSDKToken("YOUR_SDK_TOKEN_HERE", tokenExpirationHandler = ExpirationHandler()) // ExpirationHandler is optional
Java
Java
Copy

class ExpirationHandler implements TokenExpirationHandler {

    @Override
    public void refreshToken(@NotNull Function1<? super String, Unit> injectNewToken) {
        //Your network request logic to retrieve SDK token goes here
        injectNewToken.invoke("NEW_SDK_TOKEN"); // if you pass `null`  sdk exit with token expired error
    }
}

OnfidoConfig.Builder config = new OnfidoConfig.Builder(context)
                .withSDKToken("YOUR_SDK_TOKEN", new ExpirationHandler()); // ExpirationHandler is optional

Mobile token

Mobile token usage is still supported, but it will be removed 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 you will find these two sandbox tokens inside your Onfido Dashboard.

You MUST use the mobile token and not the API token when configuring the SDK itself.

Example Usage
Kotlin
kotlin
Copy
val config = OnfidoConfig.builder(context)
    .withToken("YOUR_MOBILE_TOKEN_HERE")
    .withApplicant("YOUR_APPLICANT_ID_HERE")
Java
Java
Copy
OnfidoConfig.Builder config = new OnfidoConfig.Builder(this)
                    .withToken("YOUR_MOBILE_TOKEN_HERE")
                    .withApplicant("YOUR_APPLICANT_ID_HERE");

5. Instantiating the client

To use the SDK, you need to obtain an instance of the client object:

Java
Copy
final Context context = ...;
Onfido onfido = OnfidoFactory.create(context).getClient();

6. Starting the flow

Java
Copy
// start the flow. 1 should be your request code (customise as needed)
onfido.startActivityForResult(this,         /*must be an Activity or Fragment (support library)*/
                              1,            /*this request code will be important for you on onActivityResult() to identity the onfido callback*/
                              config);

Congratulations! You have successfully started the flow.

Carry on reading the next sections to learn how to:

  • handle callbacks
  • customise the SDK
  • create checks

Core Resources

Handling callbacks

To receive the result from the SDK flow, you should override the method onActivityResult on your Activity or Fragment. Typically, on success, you would create a check on your backend server.

Java
Copy
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    ...
    onfido.handleActivityResult(resultCode, data, new Onfido.OnfidoResultListener() {
        @Override
        public void userCompleted(Captures captures) {
            //communicate with your backend and initiate the check
        }

        @Override
        public void userExited(ExitCode exitCode) {
            //User left the sdk flow without completing it
        }

        @Override
        public void onError(OnfidoException exception) {
            // An exception occurred during the flow
        }
    });
}

When the user has successfully completed the flow, and the captured photos or videos have been uploaded, the userCompleted method will be invoked. The Captures object contains information about the document and face captures made during the flow. With the applicant id, you can then create a check for the user via your backend. On the other hand, if the user exits the flow without completing it, the userExited method will be invoked. Note: Some images may have already been uploaded by this stage.

Sample of a Captures instance returned by a flow with FlowStep.CAPTURE_DOCUMENT and FlowStep.CAPTURE_FACE:

Copy
Document:
        Front: DocumentSide(id=document_id, side=FRONT, type=DRIVING_LICENCE)
        Back: DocumentSide(id=document_id, side=BACK, type=DRIVING_LICENCE)
        Type: DRIVING_LICENCE
Face:
    Face(id=face_id, variant=PHOTO)

type property refers to DocumentType

variant refers to FaceCaptureVariant

As part of userCompleted method, the DocumentType property can only contain the values which are supported by Onfido API. Please check out our API documentation.

Customising SDK

Flow customisation

You can customise the flow of the SDK via the withCustomFlow(FlowStep[]) method. You can remove, add and shift around steps of the SDK flow.

Java
Copy
final FlowStep[] defaultStepsWithWelcomeScreen = new FlowStep[]{
    FlowStep.WELCOME,                       //Welcome step with a step summary, Optional
    FlowStep.CAPTURE_DOCUMENT,              //Document Capture Step
    FlowStep.CAPTURE_FACE,                  //Face Capture Step
    FlowStep.FINAL                          //Final Screen Step, Optional
};

final OnfidoConfig config = OnfidoConfig.builder()
    .withCustomFlow(defaultStepsWithWelcomeScreen)
    .withSDKToken("YOUR_SDK_TOKEN")
    .build();

Also, by calling the exitWhenSentToBackground() method of the OnfidoConfig.Builder, you can determine that the flow should be exited whenever the user sends the app to background. This exit action will invoke the userExited(ExitCode exitCode) callback described in handling callbacks.

Welcome

In this step the user is presented with a summary of the capture steps he/she is about to pass through.

This is an optional screen.

Document

In this step the user can pick which type of document to capture, the document origin country, and then use the phone camera to capture it.

Document selection and country selection are both optional screens in the SDK flow. These screens will only show to the end user if specific options are not configured to the SDK.

To customise a document capture step you can use the DocumentCaptureStepBuilder class's functions for the corresponding document types.

Document TypeConfiguration FunctionConfigurable Properties
PassportforPassport()
Driving LicenceforDrivingLicence()
  • country
  • documentFormat
National Identity CardforNationalIdentity()
  • country
  • documentFormat
VisaforVisa()
  • country
Residence PermitforDrivingLicence()
  • country
Work PermitforWorkPermit()
  • country
GenericforGenericDocument()
  • country

Generic document type doesn't offer an optimised capture experience for a desired document type.

Configuring Country

Country configuration allows you to specify the country of origin of the document.

You can specify country for all document types except Passport. This is because passports have the same format worldwide so the SDK does not require this additional information. The country selection screen is not displayed for Passport document type.

Example to specify a country for a driving license:

Java
Java
Copy
FlowStep drivingLicenceCaptureStep = DocumentCaptureStepBuilder.forDrivingLicence()
                .withCountry(CountryCode.GB)
                .build();
Kotlin
kotlin
Copy
val drivingLicenceCaptureStep = DocumentCaptureStepBuilder.forDrivingLicence()
                .withCountry(CountryCode.GB)
                .build()

Configuring Document Format

This configuration allows you to specify the format of document such as CARD or FOLDED. If FOLDED is configured a specific template overlay is shown to the user during document capture.

You can specify FOLDED document format for French driving license, South African national identity and Italian national identity only. If you configure the SDK with an unsupported country configuration the SDK will throw an InvalidDocumentFormatAndCountryCombinationException errror.

Example to specify a country and document format for a driving license:

Java
Java
Copy
FlowStep drivingLicenceCaptureStep = DocumentCaptureStepBuilder.forDrivingLicence()
                .withCountry(CountryCode.FR)
                .withDocumentFormat(DocumentFormat.FOLDED)
                .build();
Kotlin
kotlin
Copy
val drivingLicenceCaptureStep = DocumentCaptureStepBuilder.forDrivingLicence()
                .withCountry(CountryCode.FR)
                .withDocumentFormat(DocumentFormat.FOLDED)
                .build()

Please be aware that we don't support every document and country combination. Unsupported documents will not be verified.

If you decide to bypass the default country selection screen by replacing the FlowStep.CAPTURE_DOCUMENT with a CaptureScreenStep, please make sure that you are specifying a supported document. We provide an up-to-date list of the documents we support here.

Face

In this step, a user can use the front camera to capture either a live photo of their face, or a live video. If capturing a live video, the user will be prompted to perform two simple challenges.

The photo option can be instantiated with FlowStep.CAPTURE_FACE or FaceCaptureStepBuilder.forPhoto() and the video option with FaceCaptureStepBuilder.forVideo().

By default both face and video variants show an introduction screen. You can disable the intro using withIntro(false) function.

Java
Copy
FlowStep faceCaptureStep = FaceCaptureStepBuilder.forVideo()
                .withIntro(false)
                .build();

By default the video capture confirmation screen will display a preview of the recorded video. If you would not like to display the recorded video on the confirmation screen, you can hide it using the withConfirmationVideoPreview function.

Java
Copy
FlowStep faceCaptureStep = FaceCaptureStepBuilder.forVideo()
                .withConfirmationVideoPreview(false)
                .build();

A custom flow cannot contain both the photo and video variants of the face capture.

In case both types of FaceCaptureStep are added to the same custom flow, a custom IllegalArgumentException will be thrown at the beginning of the flow, with the message "Custom flow cannot contain both video and photo variants of face capture".

Finish

The final screen displays a completion message to the user and signals the end of the flow.

This is an optional screen.

Theme customisation

In order to enhance the user experience during the transition between your application and the SDK, you can provide some customisation by defining certain colors inside your own colors.xml file:

  • onfidoColorPrimary: Defines the background color of the Toolbar which guides the user through the flow

  • onfidoColorPrimaryDark: Defines the color of the status bar above the Toolbar

  • onfidoTextColorPrimary: Defines the color of the title on the Toolbar

  • onfidoTextColorSecondary: Defines the color of the subtitle on the Toolbar

  • onfidoColorAccent: Defines the color of the FloatingActionButton which allows the user to move between steps, as well as some details on the alert dialogs shown during the flow

  • onfidoPrimaryButtonColor: Defines the background color of the primary action buttons (e.g. proceed to the next flow step, confirm picture/video, etc), the color of the text on the secondary action buttons (e.g. retake picture/video) and the background color of some icons and markers during the flow

  • onfidoPrimaryButtonColorPressed: Defines the background color of the primary action buttons when pressed

  • onfidoPrimaryButtonTextColor: Defines the color of the text inside the primary action buttons

Localisation

The Android SDK already comes with out-of-the-box translations for the following locales:

  • English (en) šŸ‡¬šŸ‡§
  • Spanish (es) šŸ‡ŖšŸ‡ø
  • French (fr) šŸ‡«šŸ‡·
  • German (de) šŸ‡©šŸ‡Ŗ

You could also provide custom translations for locales that Onfido doesn't currently support. To do this you will need an additional XML strings file inside your resources folder for the desired locale (e.g. res/values-it/onfido_strings.xml for :it: translation), with the content of our strings.xml file, translated for that locale.

By default, we infer the language to use from the device settings. However, you can also use the withLocale(Locale) method of the OnfidoConfig.Builder to select a specific language.

Notes:

  • 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 this feature.
  • If you want a locale translated you can also get in touch with us at android-sdk@onfido.com.
  • When adding custom translations, please make sure you add the whole set of keys we have on strings.xml. In particular, onfido_locale, which identifies the current locale being added, must be included. The value for this string should be the ISO 639-1 2-letter language code corresponding to the translation being added. Without this string correctly translated, we won't be able to determine which language the user is likely to use when doing the video liveness challenge. It may result in our inability to correctly process the video, and the check may fail.

Examples:

Copy
- When adding a translations file inside `values-ru` (russian translation), the `onfido_locale` key should have `ru` as its value.
- When adding a translations file inside `values-en-rUS` (american english translation), the `onfido_locale` key should have `en` as its value.

Creating checks

The SDK is only responsible for the capture and upload of photos and videos. To create a check you would need to start a check on your backend server using the Onfido API.

1. Obtaining an API token

All API requests must be made with an API token included in the request headers. You can find your API token (not to be mistaken with the mobile token) inside your Onfido Dashboard.

Refer to the Authentication section in the API documentation for details. For testing, you should be using a sandbox token, and 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.

shell
Copy
$ 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 should 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 here.

3. Setting up webhooks

Refer to the Webhooks section in the API documentation for details.

User Analytics

The SDK allows you to track a user's journey through the verification process via an overridable hook. This is meant to give some insight into how your users make use of the SDK screens.

Overriding the hook

In order to expose a user's progress through the SDK a hook method must be overridden in the UserEventHandler.kt object that's stored in the Onfido.kt interface. This can be done anywhere within your application and might look something like the following:

Java:

Java
Copy
Onfido.Companion.setUserEventHandler(new UserEventHandler() {
    @Override
    public void handleEvent(@NotNull String eventName, @NotNull Properties eventProperties) {
        // Your code here
    }
});

Kotlin:

kotlin
Copy
Onfido.userEventHandler = object: UserEventHandler() {
    override fun handleEvent(eventName: String, eventProperties: Properties) {
        // Your code here
    }
}

The code inside of the overridden 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 parameters being passed in are as follows:

  • eventName: A String indicating the type of event. This value will always return a user's visiting SDK screen name.
  • properties: A Map object containing the specific details of an event. This will contain things such as the name of the screen visited.

Using the data

Currently we recommend using the above hook to keep track of how many users reach each screen in your flow. You can do this by storing the count of users that reach each screen and comparing them to the number of users who have made it to the Welcome screen.

Tracked events

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

Copy
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

More information

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. We will need to replace the sandbox tokens in your code with 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

Cross platform frameworks

We provide integration guides and sample applications to help customers integrate the Onfido Android SDK with applications built using the following cross-platform frameworks:

We don't have out-of-the-box packages for such integrations yet, but these projects show complete examples of how our Android SDK can be successfully integrated in projects targeting these frameworks. Any issue or question about the existing integrations should be raised on the corresponding repository and questions about further integrations should be sent to android-sdk@onfido.com.

Accessibility

The Onfido Android 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 TalkBack 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

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 an Array<String> with sha-1/sha-256 hashes of certificates' public keys. In case you are interested in using this feature, for more information about the hashes, please reach out to us at android-sdk@onfido.com.

Getting notified about releases

In case you want to get notified about our releases, feel free to access our Bintray page and click the Watch button.

Licensing

Due to API-design constraints, and to avoid possible conflicts during the integration, we bundle some of our 3rd party dependencies as repackaged versions of the original libraries. For those, we include the licensing information inside our .aar, namely on the res/raw/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.

Sample App

We have included a sample app to show how to integrate the Onfido SDK. Please check out our sample app.

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 android-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).

API Documentation

Further information about the underlying Onfido API is available in our documentation here.

Onfido Android SDK Migration Guide

7.4.0 -> 8.0.0

Breaking changes
  • Minimum Android API level (minSdkVersion) support has been updated from 16 to 21. Onfido SDK will stop supporting Android 4.x starting with this version.
Added Strings:
  • onfido_outro_body
Changed Strings:
  • onfido_video_confirmation_button_primary

7.3.0 -> 7.4.0

Added Strings:
  • onfido_app_title_doc_capture_id_za
Changed Strings:
  • āš ļø Most of the localisation keys have been renamed. If you have customised any of the Onfido SDK's strings in your project, you may use migrate-keys.rb script and key mapping file key_migration_7_3_0_mapping.json to migrate from 7.3.0 to 7.4.0
Bash
Copy
  migrate-keys.rb --files-path <app/src/main/res/> --platform android --key-mapping-file key_migration_7_3_0_mapping.json

7.0.0 -> 7.1.0

Deprecation
  • EnterpriseFeatures class' constructor is deprecated. Please use EnterpriseFeatures.Builder instead.
Before
Kotlin
kotlin
Copy
EnterpriseFeatures(true)
Java
Java
Copy
new EnterpriseFeatures(true);
After
Kotlin
kotlin
Copy
val enterpriseFeatures: EnterpriseFeatures = EnterpriseFeatures.Builder().withHideOnfidoLogo(true).build()
Java
Java
Copy
EnterpriseFeatures enterpriseFeatures = EnterpriseFeatures.builder().withHideOnfidoLogo(true).build();

6.0.0 -> 7.0.0

Breaking changes
  • Migrated to AndroidX. If your app hasn't completed AndroidX migration yet, please see AndroidX Migration.
Changed Strings:
  • onfido_autocapture_manual_fallback_title
  • onfido_autocapture_manual_fallback_description

5.6.0 -> 6.0.0

Breaking changes
  • Removed out-of-the-box Portuguese (pt) translation. If you would like to keep supporting Portuguese by providing your own XML files, please see README
  • SDK will return DocumentType.UNKNOWN to mirror the Onfido API response as part of the Captures object which is provided by handleActivityResult if residence permit or generic is selected
Added strings:
  • onfido_accessibility_video_pause
  • onfido_accessibility_video_play

5.5.0 -> 5.6.0

Deprecation
  • The CaptureScreenStep class is deprecated. We now recommend DocumentCaptureStepBuilder to customise document capture steps
Before
Java
Java
Copy
new CaptureScreenStep(DocumentType.NATIONAL_IDENTITY_CARD, CountryCode.GB);
Kotlin
kotlin
Copy
CaptureScreenStep(DocumentType.NATIONAL_IDENTITY_CARD, CountryCode.GB)
After
Java
Java
Copy
DocumentCaptureStepBuilder.forNationalIdentity()
                .withCountry(CountryCode.GB)
                .build();
Kotlin
kotlin
Copy
DocumentCaptureStepBuilder.forNationalIdentity()
                .withCountry(CountryCode.GB)
                .build()
  • The FaceCaptureStep class is deprecated. We now recommend FaceCaptureStepBuilder to customise face capture steps
Before
Java
Java
Copy
FlowStep selfieCaptureStep = new FaceCaptureStep(new FaceCaptureVariantPhoto(false));

FlowStep videoCaptureStep = new FaceCaptureStep(new FaceCaptureVariantVideo(false));
Kotlin
kotlin
Copy
val selfieCaptureStep = FaceCaptureStep(FaceCaptureVariantPhoto(false))

val videoCaptureStep = FaceCaptureStep(FaceCaptureVariantVideo(false))
After
Java
Java
Copy
FlowStep selfieCaptureStep = FaceCaptureStepBuilder.forPhoto()
                .withIntro(false)
                .build();

FlowStep videoCaptureStep = FaceCaptureStepBuilder.forVideo()
                .withIntro(false)
                .build();
Kotlin
kotlin
Copy
val selfieCaptureStep = FaceCaptureStepBuilder.forPhoto()
                .withIntro(false)
                .build()

        val videoCaptureStep = FaceCaptureStepBuilder.forVideo()
                .withIntro(false)
                .build()
Added strings:
  • onfido_mrz_not_detected_title
  • onfido_mrz_not_detected_subtitle

5.3.3 -> 5.4.0

Added strings:
  • 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
Deprecation
  • Deprecated properties of DocumentType class

4.5.0-F5 -> 5.3.2 - [enterprise]

Breaking changes
  • Removed OnfidoCertificatePinningSettings class which has ONFIDO_API parameter to provide root certificate's hash value. For more information, please visit our README.md

5.2.0 -> 5.3.0

Added strings:
  • onfido_label_doc_type_generic_up
Changed Strings:
  • onfido_accessibility_liveness_video_example

5.1.0 -> 5.2.0

Added strings:
  • onfido_accessibility_liveness_face_detected

5.0.1 -> 5.1.0

Added strings:
  • onfido_accessibility_camera_document_capture_view
  • onfido_accessibility_face_confirmation_view
  • onfido_accessibility_document_confirmation_view
  • onfido_accessibility_liveness_confirmation_view
  • onfido_accessibility_video_preview_recorded
  • onfido_accessibility_liveness_digits
  • onfido_accessibility_liveness_move
  • onfido_accessibility_then
  • onfido_accessibility_liveness_left
  • onfido_accessibility_liveness_right
  • onfido_accessibility_liveness_play_pause
  • onfido_accessibility_take_picture

5.0.0 -> 5.0.1

Changed
  • No longer obfuscating com.monadtek.mvp package

4.11.0 -> 5.0.0

Applicant removal and Token change
Breaking change
  • Applicant class removed from the SDK
  • Applicant parameter removed from the OnfidoResultListener callback methods
  • Removed deprecated withApplicant(Applicant) method on the OnfidoConfig.Builder class as SDK no longer creates applicants
Deprecation
  • The withApplicant(String) and the withToken(String) methods are deprecated from the OnfidoConfig.Builder, we now recommend that create a SDK Token on your backend which contains applicantId and use withSDKToken(String) method to initialise the OnfidoConfig
Before

The initialisation of the SDK by passing the applicant ID and the (static) mobile token:

Copy
val OnfidoConfig config = OnfidoConfig.builder()
            .withToken("YOUR_MOBILE_TOKEN")
            .withApplicant("YOUR_APPLICANT_ID")
            .build();

or if you were using the deprecated withApplicant(Applicant) method:

Copy
val applicant = Applicant.builder()  
        .withFirstName("Your first name")  
        .withLastName("Your first name")  
        .build()  
  
val onfidoConfig = OnfidoConfig.builder()  
        .withApplicant(applicant)
        .withToken("YOUR_MOBILE_TOKEN")
        .build();

The SDK callback where the Applicant type object was passed:

Copy
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    ...
    onfido.handleActivityResult(resultCode, data, new Onfido.OnfidoResultListener() {
        @Override
        public void userCompleted(Applicant applicant, Captures captures) {
            //communicate with your backend and initiate the check
        }

        @Override
        public void userExited(ExitCode exitCode, Applicant applicant) {
            //User left the sdk flow without completing it
        }

        @Override
        public void onError(OnfidoException exception, @Nullable Applicant applicant) {
            // An exception occurred during the flow
        }
    });
}
After

Neither the (static) mobile token nor the Applicant ID are expected anymore, you are now expected to pass the SDK token which is generated by calling the Onfido API:

Copy
val sdkToken: String = createSdkToken() // https://github.com/onfido/onfido-android-sdk/blob/master/README.md#41-sdk-token 
  
val onfidoConfig = OnfidoConfig.builder(context)  
        .withSDKToken(sdkToken) 
        .build()

The SDK callback no longer passes an Applicant object:

Copy
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    ...
    onfido.handleActivityResult(resultCode, data, new Onfido.OnfidoResultListener() {
        @Override
        public void userCompleted(Captures captures) {
            //communicate with your backend and initiate the check
        }

        @Override
        public void userExited(ExitCode exitCode) {
            //User left the sdk flow without completing it
        }

        @Override
        public void onError(OnfidoException exception) {
            // An exception occurred during the flow
        }
    });
}

US Driver's license optional feature

Breaking change
  • Removed withUSDLAutocapture() method from the OnfidoConfig.Builder. Autocapture enabled by default for the US driving licences.
Added strings:
  • onfido_autocapture_manual_fallback_title
  • onfido_autocapture_manual_fallback_description
Removed strings:
  • onfido_autocapture_info
  • onfido_press_button_capture
  • onfido_barcode_error_subtitle
  • onfido_barcode_error_third_title
Changed Strings:
  • onfido_barcode_error_title

4.8.0 -> 4.11.0

Added strings:
  • onfido_accessibility_liveness_video_example
  • onfido_accessibility_camera_face_capture_view

4.7.0 -> 4.8.0

Added strings:
  • onfido_label_doc_type_work_permit_up
  • onfido_message_side_document_front_generic
  • onfido_message_side_document_back_generic
  • onfido_message_check_readability_subtitle_generic
  • onfido_message_document_capture_info_front_generic
  • onfido_message_document_capture_info_back_generic
  • onfido_confirm_generic_document
Removed strings:
  • onfido_label_doc_type_passport
  • onfido_label_doc_type_driving_license
  • onfido_label_doc_type_id_card
  • onfido_label_doc_type_visa

4.6.0 -> 4.7.0

Changed Strings:
  • onfido_country_selection_toolbar_title
  • onfido_unsupported_document_description

4.5.1 -> 4.6.0

Added Strings:
  • onfido_label_doc_type_visa
  • onfido_label_doc_type_visa_up
  • onfido_message_document_visa
  • onfido_message_check_readability_subtitle_visa
  • onfido_confirm_visa
  • onfido_liveness_intro_subtitle
  • onfido_liveness_intro_step_1_title
  • onfido_liveness_intro_step_2_title
  • onfido_liveness_intro_loading_video
  • onfido_reload
  • onfido_unable_load_unstable_network
  • onfido_unable_load_offline
Removed strings:
  • onfido_next
  • onfido_liveness_intro_title
  • onfido_liveness_intro_subtitle_1_action
  • onfido_liveness_intro_subtitle_2_actions
  • onfido_liveness_intro_subtitle_some_actions
  • onfido_liveness_intro_third_subtitle_1_action
  • onfido_liveness_intro_third_subtitle_2_actions
  • onfido_liveness_intro_third_subtitle_some_actions
  • onfido_liveness_challenge_open_mouth_title
  • onfido_liveness_challenge_next
  • onfido_liveness_challenge_stop
  • onfido_stop
  • onfido_liveness_challenge_recording
  • onfido_video_recorded
  • onfido_camera_access_recover_instructions_subtitle

3.0.0 -> 4.0.0

  • Changed the Applicant parameter on the userCompleted(Applicant applicant, Captures captures) callback to be a non-nullable field, meaning that we guarantee this field will always contain information about the applicant whenever this callback is called. Any null check being applied may now be deleted.
  • Changed the Applicant parameter on the onError(OnfidoException exception, @Nullable Applicant applicant) callback to be a nullable value, meaning that depending on the error originating the callback, the applicant details might be null. Therefore, developers should add the correspondent null check before accessing its information.

2.4.0 -> 3.0.0

  • Added onError(OnfidoException exception, Applicant applicant) method on the Onfido object, used to get the result of the identity verification flow. This callback will be called whenever an exception that the end-user should not be able to overcome by itself occurs during the flow. The new method should be implemented and the exception handled accordingly.

  • Upgraded our infrastructure and SDK client SSL configurations to support TLSv1.2 only. According to the relevant Google documentation, this support comes enabled by default on every device running Android API 20+. In case you need to support devices older than that in your integration with the Onfido Android SDK, we need to access Google Play Services to install the latest security updates, which enable this support. As such, if you don't use Google Play Services on your integration yet, we require you to add the following dependency:

    gradle
    Copy
    compile ('com.google.android.gms:play-services-base:x.y.z') {
               exclude group: 'com.android.support' // to avoid conflicts with your current support library
    }
    

2.0.0 -> 2.1.0

Deprecations
  • Deprecated withApplicant(Applicant applicant) method. We now recommend that you create an Onfido applicant yourself on your backend and the withApplicant(String id) method should be called with the id of the created applicant.

1.0.0 -> 2.0.0

Breaking changes
  • Removed FlowStep.MESSAGE_FACE_VERIFICATION, which is now automatically added before any face capture with the variant FaceCaptureVariant.PHOTO. This way, any inclusion of this step in a custom flow should be removed

0.9.2 -> 1.0.0

Breaking changes
  • Removed the allowMetrics(boolean) method from the OnfidoConfig.Builder object. Every call to this method should be deleted
  • Removed the previously deprecated FlowStep.MESSAGE_IDENTIFY_VERIFICATION enum instance, as it was too specific for our generic flow intentions. Every previous inclusion of this object on a flow should be replaced by a custom MessageScreenStep

Change Log

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

[8.0.0] - 2020-12-16

Added
  • Public: Added an option to hide the recorded video on the confirmation screen. For more information, please see customising the SDK.
Changed
  • Public: Dropped support for Android 4.x
  • Public: Now cropping document images before sending them to the backend
  • UI: Updated Final Screen design

[7.4.0] - 2020-10-20

Added
  • Public: Added support for South African ID folded paper document capture
Changed
  • Public: Renamed most of the localisation keys. Now, names are more explicit in which screens they are being used. Please visit our MIGRATION.md
  • Public: Remove duplication in the README file

[7.3.0] - 2020-08-27

Added
  • Public: Added config to enable manual liveness capture
Changed
  • UI: Removed Singapore endonym

[7.2.0] - 2020.07.06

Changed:
  • Public: Improved US Driver Licence auto-capture performance
Fixed:
  • Public: Fixed an issue which was causing a false positive and improved MRZ detection on passports
  • Public: Fixed some rare crashes related to CameraAPI
Removed:
  • Internal: Removed the zxing library dependency

[7.1.0] - 2020.06.25

Added:
  • UI: Added co-branding feature - [enterprise]
Removed:
  • Internal: Removed RxJavaPlugins.setErrorHandler usage that was causing IllegalStateException when RxJavaPlugins.setErrorHandler used on host app
Fixed:
  • UI: Fixed infinite loader issue that was happening during video upload operation

[7.0.0] - 2020-06-15

Changed:
  • UI: Changed Onfido watermark design
  • UI: Realtime glare detection is disabled for the backside of Romanian national identity card
  • UI: Updated auto-capture manual fallback alert
  • Internal: Migrated to AndroidX. For more information, please visit our MIGRATION.md
  • Internal: Bump OkHttp version to 3.12.12 to avoid potential Android 11 issues
Fixed:
  • UI: Fixed Xiaomi specific zoom issue on the video preview

[6.0.0] - 2020-04-30

Added:
  • UI: Added play and pause to the liveness intro auto-play view in order to improve accessibility
  • UI: Added German language support
  • UI: Added dynamic enterprise feature configuration (e.g. hiding Onfido logo) - [enterprise]
  • Public: Added information on api/token regions to documentation
Changed:
  • Public: Now using API v3 for communication with the backend
  • Internal: Extended basic device information logging to all relevant API requests
Removed:
  • Public: Removed out-of-the-box Portuguese (pt) translation
Fixed:
  • UI: Fixed document template overlay and edge detection message overlapping issue
  • UI: Fixed a bug that caused the no face found warning to not display on the selfie capture screen
  • Public: Fixed localization problems on liveness instructions
  • Public: Fixed supported folded document types explanation on README
  • Public: Fixed a bug that threw InvalidDocumentFormatAndCountryCombinationException on NationalIdentityCaptureStepBuilder and DrivingLicenceCaptureStepBuilder when configured with country code and document format except CountryCode.FR and CountryCode.IT
  • Public: Fixed a bug that was causing sending not supported document type property to the Onfido backend.

[5.6.0] - 2020-03-16

Added:
  • Public: Added Fragment support to be able to start the SDK using a Fragment instance
  • Public: Added integrator defined event hook to allow integrators to collect user analytics
  • Public: Added DocumentCaptureStepBuilder and FaceCaptureStepBuilder to create FlowStep in order to customise SDK flow. For more information, please visit our README.md
  • UI: Now showing error message when passport MRZ is cut off in captured image
Changed:
  • Public: Updated code snippets and descriptions related to API V3 in README
  • Public: Changed 'mobile sdk token' expression with 'mobile token' in README to prevent confusion
  • Public: Updated full and core SDK implementation code snippets in README
  • Internal: Updated the following network libraries on onfido-api-client:
    • com.squareup.retrofit2:retrofit:2.1.0 -> com.squareup.retrofit2:retrofit:2.6.4
    • com.squareup.okhttp3:okhttp:3.3.0 -> com.squareup.okhttp3:okhttp:3.12.8
    • com.jakewharton.retrofit:retrofit2-rxjava2-adapter-> io.reactivex.rxjava2:rxandroid:2.1.1
  • UI: Now using grey Onfido logo with higher contrast for accessibility
  • UI: Screen reader order has been changed for better accessibility
  • UI: Document guide overlay will be kept on the screen for longer
Deprecated:
  • Public: The CaptureScreenStep class deprecated. For more information, please visit our MIGRATION.md
  • Public: The FaceCaptureStep class deprecated. For more information, please visit our MIGRATION.md
Fixed:
  • Public: Fixed wrong document type in Captures class for preselected DocumentType.RESIDENCE_PERMIT
  • Public: Fixed the TokenExpirationHandler class's java compatibility

[5.5.1] - [enterprise] - 2020-03-06

Added:
  • Internal: Added ENTERPRISE_README.md
  • Internal: Added publish-configuration.properties file to manage publishing artifact
Changed:
  • UI: Onfido logo hidden instead using transparent onfido_ic_watermark

[5.5.0] - 2020-02-17

Changed:
  • UI: Improved UX on liveness digit challenge

[5.4.0] - 2020-01-23

Added:
  • Public: Face property added into Captures class
  • Public: Added sample-app directory, in order to show sample usage of the sdk
  • UI: Added folded document template for French driving license and Italian identity document
  • UI: Updated README.md to clarify mobile token usage
Changed:
  • Internal: Updated Kotlin version to 1.3.50
  • UI: Changed camera overlay background color's opacity to enhance accessibility support

[5.3.3] - 2020-01-08

Fixed:
  • Public: Fixed a crash when using sdkToken with proguard enabled

[5.3.2] - [enterprise] - 2019-12-18

Added:
  • Public: Migration guide updated regarding to OnfidoCertificatePinningSettings changes

[5.3.1] - 2019-12-16

Fixed:
  • UI: Fixed a crash when inflating the onfido_ic_watermark
  • UI: Fixed a bug that was preventing the Onfido logo to be visible

[5.3.0] - 2019-11-28

Added:
  • Public: DocumentType.GENERIC type added. For more information, please visit our README.md
Changed:
  • UI: Liveness intro video accessibility string improved
  • UI: Added folded paper document support for French driving license and Italian identity document

[5.2.0] - 2019-11-12

Added:
  • UI: java.lang.Deprecated annotation added additionally for the deprecated functions
  • Internal: Improved RxJava2 error handling
Changed:
  • UI: Updated README to clarify APPLICATION_ID term and how to obtain sandbox token
  • UI: Manual capture button showed after the user click retake or back button for passport and US DL
  • UI: For passports and US Driving Licenses (DL) the manual capture button is shown after the user clicks on retake or on the back button.
  • UI: The manual fallback countdown changed
  • Internal: Changed token expiration identifier for the onfido-api-client

[5.1.0] - 2019-10-14

Added:
  • Public: Added SDK token support for US region
  • Public: Added ability to refresh SDK token when it expired. For more information, please visit our [README.md](README.md#4.1 SDK Token)
  • Internal: Basic device information started to logging
Changed:
  • Public: onfido-api-client dependency now bundled with the SDK, instead of getting downloaded as a transitive dependency.
  • Public: Added option to disable liveness intro video (FaceCaptureStep(FaceCaptureVariantVideo(showIntroVideo = false)))
Removed:
  • Public: Removed check() and checkStatus() functions from OnfidoAPI

[5.0.1] - 2019-09-06

Changed:
  • Public: Improvements on our source code obfuscation strategy

[5.0.0] - 2019-08-20

Added:
  • Public: Added SDK token support (EU region)
Changed:
  • Public: Removed Applicant parameter from OnfidoResultListener callback methods
  • Internal: ApplicantId became mandatory parameter for 'OnfidoConfig' for mobileToken preferences
Removed
  • Public: Removed the withUSDLAutocapture() method from the OnfidoConfig.Builder. The autocapture of the United States' driving license is now enabled by default
  • Public: Removed applicant creation using the SDK, along with the withApplicant(Applicant) method of the OnfidoConfig.Builder. The applicant should always from now on be created outside of the SDK and its id used to initialise the flow withApplicant(String) on the OnfidoConfig.Builder

[4.11.1] - 2019-11-07

Note Changes in this version are the changes applied on v5.0.1 to 4.11.0

Added:
  • Internal: Improved RxJava2 error handling
Changed:
  • Public: Improvements on our source code obfuscation strategy

[4.11.0] - 2019-08-12

No changes since the previous release candidate version

[4.11.0-rc.1] - 2019-08-09

Added:
  • Internal: Support new token format
  • Public: Added certificate pinning support. For more information, please visit our README.md
Changed:
  • Internal: Performance improvements to our liveness face tracking feature

[4.10.0] - 2019-07-18

Added:
  • Public: Added support for Gradle 5 and Android Studio Gradle plugin 3.4.x
Changed:
  • UI: Improved the video capture challenge generation and added error handling

[4.9.0] - 2019-06-11

Added:
  • Public: Added United States' driver's license autocapture as an experimental feature. Can be enabled by calling withUSDLAutocapture() in the OnfidoConfig.Builder
Changed:
  • UI: Optimised liveness intro videos resolution and duration, reducing overall size
Fixed:
  • Public: Fixed a crash when the host app was being killed by the system after sent to background and then recovered from, e.g., the recent apps list
  • Public: Fixed a crash rarely happening when a user navigates through the liveness challenges flow

[4.8.1] - 2019-06-20

Changed:
  • Internal: Removed the strict requirement for the device to support autofocus in order to run the SDK.
Fixed:
  • Public: Fixed a bug that was causing the onfidoPrimaryButtonTextColor attribute to have no effect in the main button customisation

[4.8.0] - 2019-04-04

Added:
  • Public: Added the ability to skip the selfie intro screen by adding the FaceCaptureVariantPhoto that can be passed as an argument to a FaceCaptureStep
  • Public: Added the ability for integrators to specify a Locale for the flow to be displayed with, instead of inferring it from the device settings
  • Public: Added the ability for integrators to enable an "exit when sent to background" mode in the SDK flow through the exitWhenSentToBackground() in the OnfidoConfig.Builder. This mode enforces that the flow will automatically exit through the userExited() callback whenever the app is sent to background mid-flow
  • Public: Added support for preselection of work permit documents, through the DocumentType.WORK_PERMIT enum value. This is a beta feature
Changed:
  • Internal: Upgraded OpenCV version to 3.4.5
  • Internal: Now asking for the capture of both sides of the DocumentType.NATIONAL_IDENTITY_CARD from CountryCode.IN (indian national identity card)
Fixed:
  • Public: Fixed crash when initialising the capture screen and system returned a null camera to the SDK
  • Public: Fixed crash in the liveness confirmation screen, related with the usage of a vector drawable as the background of a button
  • Public: Fixed a crash when initialising the capture screen and we are not able to retrieve the camera parameters from the system
  • Public: Fixed crash happening when the activity android:label property is required to be non-blank

[4.7.0] - 2019-03-05

Changed:
  • Public: Improved the documentation about adding custom translations and the onfido_locale string
  • UI: Linked text views to the Onfido design system
Fixed:
  • Public: Fixed crash when the SDK was wrongly doing operations with unknown request codes when transitioning from the capture screen to the flow screen
  • Public: Fixed crash when the SDK tries to access a view after the app was sent to background
  • Public: Fixed a crash when uploading the liveness video when the filename contains characters not supported by OkHttp
  • Public: Fixed a crash happening when face detection or tracking started on a device/emulator without Play Services
  • Public: Fixed a crash when reporting an error during the video recording back to the user while the error callback is null
  • Public: Fixed crash when checking for front camera support for selfie/video purposes throws a RuntimeException
  • UI: Fixed the issue of text getting cropped when going over 2 lines in bullet views. The text can now go up to 3 lines and shows an ellipsis if the content is longer than that.

[4.6.0] - 2019-02-14

Added:
  • Public: Added support for preselection of Visa documents, through the DocumentType.VISA enum value
  • UI: Redesigned the liveness introduction screen to show an example video of the actions to perform
Changed:
  • UI: Redesigned the secondary action button to make it customisable
  • UI: Added improvements to font size display when device accessibility features are enabled

[4.5.1] - 2019-01-28

No changes since the previous release candidate version

[4.5.1-rc.2] - 2019-01-25

Changed:
  • UI: Removed all the hardcoded colour codes and now referencing the resource for every UI element with our primary UI colour
  • UI: Redesign according to the Onfido rebranding
  • Internal: Improved the face detection algorithm during liveness pre-recording to better match the oval on the screen
Fixed:
  • Public: Fixed crash when requesting camera focus after the host app was killed by the system
  • Public: Fixed crash when trying to fetch the dimensions of a view on the capture screen before it was measured for the first time

[4.5.1-rc.1] - 2018-12-20

Fixed:
  • Public: Fixed crash when initialising our face detector
  • Internal: Fixed bug when launching two consecutive flows with two distinct tokens

[4.5.0] - 2018-12-12

Added:
  • Public: Added the ability to preselect just a document type, without specifying any info about the country of origin nor ask the user to select it
  • UI: Added video review feature after live video recording
  • UI: Added face detection and automatic recording on liveness capture
  • UI: Added live face tracking during liveness challenges recording
Changed:
  • UI: Revamped liveness control buttons to provide a more explicit and easy to follow flow
  • Internal: Simplified analytics by removing lifecycle-aware events
  • Internal: Improved the repackaging method for our 3rd party dependencies
  • Internal: Updated the map for the supported countries for each document
Fixed:
  • Public: Fixed crash spotted when displaying the liveness challenges
  • Public: Fixed a crash when the search view on the country selection screen could not be properly loaded
  • Public: Fixed conflict between Kotlin enums and the jetify process required to work with AndroidX
Deprecated:
  • Public: Deprecated the custom MessageScreenStep, previously used to introduce custom messages in the flow

[4.4.0] - 2018-09-06

Added:
  • Public: Added the ability to customise action buttons and icons colors
  • Public: Added instructions for integrators to get notified about releases
  • UI: Added permission request and recovery screens for camera and microphone permissions
  • Internal: Now bundling Proguard rules with the SDK, removing the need for the host application to specify those rules for themselves
Changed:
  • UI: Revamped flow final screen
  • UI: Revamped the flat action button according to a new, more accessible design specification
  • UI: Revamped liveness control buttons to provide a more explicit and easy to follow flow
  • Internal: Changed our analytics solution from an external provider to an in-house service
Fixed:
  • Public: Fixed build time warnings

[4.3.0] - 2018-07-17

Added:
  • Internal: Added the language displayed by the SDK as a parameter on the live video upload, for speech analysis purposes
Changed:
  • UI: Moved the camera and microphone permissions request from the flow start to the capture screen
  • Internal: Changed country suggestion to fetch the country code from the SIM country instead of geo IP
  • Internal: Reduced frame size for glare detection, in order to make it more accurate
Fixed:
  • Public: Fixed a crash happening when the host app forces a support library version below ours 27.1.0
  • UI: Fixed a bug which allowed users to dismiss the bottom sheet on the country selection screen
  • UI: Fixed a bug of misalignment of video capture instructions happening when a longer than usual custom translation is provided
  • UI: Fixed a bug which caused a crop on the document validation bubble when non-regular font sizes are set

[4.2.0] - 2018-06-25

Added:
  • Public: Added error state for multiple faces detected during a face capture step
  • Public: Added a storage space monitoring strategy during liveness video recording
  • UI: Added the Onfido logo on the bottom of every bulleted message screen
  • Internal: Added tracking for the unreadable barcode warning
Changed:
  • UI: Changed post upload validation errors UI to appear as an overlay bubble instead of a system dialog
Removed
  • Public: Removed the need for the WRITE_EXTERNAL_STORAGE permission, by writing liveness recording videos to the internal storage
Fixed
  • Public: Fixed bug which caused an unexpected behaviour when pressing back during a preselected document as first flow step
  • Public: Fixed bug causing a crash when an unexpected error body is returned from the API
  • UI: Fixed bug during autocapture causing the information bottom sheet to enter an inconsistent state whenever the app was sent to background after the manual fallback threshold was triggered

[4.1.0] - 2018-05-17

Added
  • Public: Added post capture barcode detection for United States driving license captures
  • Public: Added strings.xml as a public file, in order to enable custom localisation. More information can be found in our README.md
  • Public: Added out-of-the-box Portuguese (pt) translation
Changed
  • Internal: Added onfido prefix and lint rule for every resource
  • UI: Changed glare bubble layout to comply with the new post capture validation bubble
Fixed
  • Public: Fixed a crash happening when the first camera frame was being processed before the camera screen UI was drawn.
  • Public: Fixed a bug happening when the first flow step is a capture step and the back button is pressed, causing the user to exit the flow.

[4.0.0] - 2018-04-23

Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md

Changed
  • Public: Updated dependencies to the following:
    • compileSdkVersion = 27
    • targetSdkVersion = 27
    • Android Support Library = 27.1.0
Fixed
  • Public: Fixed crash happening when a corrupted flow result Intent is passed to the handleActivityResult() method on an Onfido instance.
  • Internal: Fixed bug hiding the flow toolbar title when the SDK process was recreated after being killed by the system

[3.0.0] - 2018-04-05

Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md

Added
  • UI: Added post capture blur detection for every document type
  • UI: Added zoom & pan feature for document and face on confirmation screen
  • Public: Added cross platform frameworks section in README.md
  • Public: Added support for Singaporean residence permits as identity documents
  • Public: Added onError(OnfidoException exception, Applicant applicant) callback on the Onfido interface, used to track flow completion
Changed
  • UI: Changed confirmation screen layout and buttons
  • UI: Refactored colours across UI elements on the whole flow.
  • Internal: Upgraded API client to make use of enhanced document detection feature on backend
  • Internal: Restricted support for TLS 1.2 only on every network call, improving communication security
Fixed

[2.4.0]

Added
  • UI: Added auto-capture feature for passport
  • UI: Added loader on country suggestion (in case of slow network)
  • UI: Added French language support
  • Internal: Added new translations mechanism
Fixed
  • Internal: Fixed bug on choosing the video recording resolution
  • Internal: Fixed crash when sending the SDK to background with the Don't keep activities option enabled
Removed
  • UI: Removed the open mouth challenge from the set of available video capture challenges

[2.3.0]

Added
  • UI: Added country suggestion and search feature on the country selection screen.
  • Public: Added ability to change onfido colors without having to change the host app default color values.

Changed

  • UI: Improved validation errors copy for document and face uploads.
Removed
  • Internal: Removed Play Services Vision dependency
  • UI: Removed country availability text on document selection screen.

[2.2.0]

Changed
  • Internal: Recorded face videos are now erased from device after the flow ends.
  • UI: Replaced every FAB on the UI with a flat button.
  • UI: Changed face capture intro screen (copy) and introduced icons instead of the previous arrows.
Fixed
  • UI: Fixed bug causing overlapping screens when using 26+ support library versions

[2.1.0]

Added
  • Public: Added withApplicant(String id) method to OnfidoConfig.Builder, in order to allow users to start a flow with a previously-created Applicant.
  • Documentation: Added SDK localisation instructions in the README.md.
Deprecated
  • Public: Deprecated withApplicant(Applicant applicant) method on OnfidoConfig.Builder, in favor of newly-created withApplicant(String id). From now on, applicants should not be created inside the SDK, but using the backend instead. Flow should be started using the applicant's id only.
Changed
  • Public: Reduced SDK size

[2.0.0]

Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md

Added
  • Public: Added FaceCaptureStep(FaceCaptureVariant variant), which is a custom object to add a face capture step to the flow, with a variant of either FaceCaptureVariant.PHOTO or FaceCaptureVariant.VIDEO. Currently, the previous FlowStep.CAPTURE_FACE is still available and is equivalent to new FaceCaptureStep(FaceCaptureVariant.PHOTO)
  • UI: Added new video face capture screen as an alternative to photo face capture screen
  • Permissions: We now require the android.permission.RECORD_AUDIO permission, in order to capture audio from video Face captures
  • UI: Added Spanish translation
Removed
  • Public: Removed FlowStep.MESSAGE_FACE_VERIFICATION, which is now automatically added before any face capture with the variant FaceCaptureVariant.PHOTO
Changed
  • UI: Changed countries' names on document country selection screen so that every country's name is presented in its native language.

[1.0.0]

Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md

Added
  • UI: Added live edge detection for passport captures
  • UI: Added residence permit card as an identity verification method
Changed
  • UI: Glare detection changed from post-capture dialog warning to real-time feedback via a bubble notification
  • UI: Dialogs cancellation feature has been removed, user has to explicitly take an action
  • Internal: Improved analytics by introducing more granular tracking
Removed
  • Public: Removed allowMetrics(boolean) method from the OnfidoConfig.Builder object
  • Public: Removed previously deprecated FlowStep.MESSAGE_IDENTIFY_VERIFICATION enum instance

[0.9.2]

Changed
  • Internal: Now supporting Android Support Library in version 24 and above
Fixed
  • Internal: Fixed an old bug where the camera preview was stretched on some devices
  • Internal: Fixed toolbar color customisation on document and face capture confirmation screens

[0.9.1]

Added
  • Internal: Introduced glare detection feature for documents, bundled as JNI code. Check out README.md for more information
  • UI: Added a dialog warning the user when glare is detected on a document after taking a photo
Changed
  • UI: Enhanced document, live photo and confirmation screens
  • Internal: Changed analytics to a more client-oriented approach

[0.9.0]

Changed
  • Internal: Changed API client to use Onfido API v2 instead of v1
Removed
  • Public: Removed unused OnfidoConfig object from callbacks userCompleted() and userExited() which signal whether the user completed the proposed flow or not
Added
  • Public: Added a Captures object on the userCompleted() callback method, which contains information about the document captures made during the flow
  • Internal: Added two parameters, sdk_source and sdk_version, specifying the sdk name and version to every document or face upload calls using the API

[0.8.0]

Changed
  • Public: Deprecated MESSAGE_IDENTIFY_VERIFICATION FlowStep, since it is too specific for the purpose of the SDK, which should stay as generic as possible

  • Public: Changed the default flow, accessible through FlowStep.getDefaultFlow() to include a welcome step, also accessible as FlowStep.WELCOME

  • Public: Document capture step, accessible through FlowStep.CAPTURE_DOCUMENT now features 3 different screens. First, a document type selection screen is shown, followed by a country selection screen for the document origin country to be chosen. Finally, the camera screen for the document capture

  • Public: Redesign of the message screen which results from a MessageScreenStep

  • Internal: FlowStep.WELCOME and FlowStep.MESSAGE_FACE_VERIFICATION now have a bullet points layout with new copy

  • Internal: Added a toolbar as part of the flow UI, with a title describing the current step and the ability to return to the previous step

  • Internal: Added bottom sheet on Country Selection screen showing instructions for when the user can not find the origin country of his/her document

  • Internal: Updated Kotlin version to 1.1.1

Fixed
  • Internal: Crash on NullPointerException when trying to upload document which came as null from the camera. A null check is now performed after the picture is taken, and an error message is shown in case it is null
  • Internal: If country and document type selected is India and national id card, only the front of the document will be asked of the user. There was a mistake where this behaviour was happening with the driver's license instead.
Removed
  • Public: Removed FlowStep.MESSAGE step. Developers should add a MessageScreenStep(String title, String subtitle, String nextButtonText) to a custom flow instead, specifying which information they want to show on the screen.
  • Internal: Removed unused .png drawables
  • Internal: Removed unneeded theme from the <application> tag, which could cause conflicts with the host app's theme
Added
  • Public: Added the ability for host applications to override the flow components' colors
  • Internal: Added the document type and country to the document capture screen, and only the document type on passport captures

[0.7.1]

Changed
  • Internal: If country and document type selected is India and national ID card, only the front of the document will be asked of the user.
  • Internal: Changed side information on document captures to show only on back side captures from two-sided card documents (not Passport)
Fixed
  • Internal: Crash On RuntimeException for "Could not find requested camera". A message is now presented to the user in such cases, letting him know the camera is not available.
  • Internal: Crash On RuntimeException for "takePicture failed". A message is now presented to the user when this happens.
  • Internal: Crash on IllegalArgumentException for "meteringAreas is invalid NumFocusAreas must < 4". For devices that have a limit on the number of areas a safeguard clause was added to the code.
Removed
  • Internal: Glide was removed as a dependency. This reduced the method count to a value lower than on 0.6.0 (if code was run through Proguard).

[0.7.0-rc.3] - 2018-03-28

Fixed
  • Public: Fixed a bug on the confirmation screen where button layout would break when font size was set to the highest size
  • Public: Fixed a bug which caused the capture and confirmation screens camera view aspect ratio to be different
  • Public: Fixed a bug happening when an upload error had no hash to be parsed

[0.7.0-rc.2] - 2018-02-16

Removed
  • Internal: Removed play services dependency (with respect to 0.7.0-rc.1)

[0.7.0-rc.1]

Added
  • Public: introduced allowMetrics, which allows the developer to choose whether SDK-only metrics may be taken.
  • Public: introduced CaptureScreenStep, which allows preselection of the document type on the flow configuration, hiding the document type selection view during the flow.
  • Public: createIntent was undeprecated, this is helpful when initiating the sdk from fragments.
Removed
  • Public: deprecated methods were removed
Changed
  • Public: requestCode was removed from handleActivityResult(...) since handling it should be the host app's responsibility.

[0.6.0]

Fixed
  • Internal: Fixed crash bug that could happen if the user clicked on the confirm button too quickly (easier to reproduce on older phones)
  • Public: Fixed Glide conflict. Glide is now a standard dependency (instead of prebundled).
Removed
  • Public: Removed launcher icon from resources and manifest

[0.5.0]

Changed
  • Public: The SDK flow now exits with a code, depending on the way that the user abandoned it.
Fixed
  • Public: Crash bug fixed when the user denies camera permission.
  • Internal: Fixed crash bug caused when the main activity got recreated and its applicant became null, which caused exceptions.
  • Internal: Fixed the crash problem when another appp is using the camera in the background and the user opens the capture step at the same time. This fix informs the user of the problem, in hope the user will correct the situation.

[0.4.0]

Added
  • Internal: A confirmation step shows up before sending the photo for validation.
  • Public: Added both withBaseUrl(String) and withToken(String), which allow to customize the base url used when communicating to the backend and the possibility to set the authorization token used when communicating with said back-end.
Changed
  • Internal: Changed copy of validation error dialog.
  • Public: Deprecated getOnfidoConfigFrom(Intent), getApplicantFrom(Intent), createOnfidoApiClient() in favour of the more comprehensive api handleActivityResult(...).
Fixed
  • Public: Removed the colorAccent resource, which was causing dialog buttons to disappear.
  • Internal: Auto focus before capture has been removed, due to problems found on some devices.
  • Internal: Fixed crash on devices without flash mode.
  • Internal: Removed unused image assets.
  • Internal: autoFocus crash bug exception fixed.
  • Internal: Fixed null pointer exception crash when focus mode gets reverted in certain scenarios.

[0.3.1]

Added
  • Internal: if the captured document is not a passport, its backside is also requested.

[0.3.0]

Added
  • Public: startActivityForResult(Activity, int requestCode, OnfidoConfig) and handleActivityResult(int requestCode, int resultCode, Intent, OnfidoResultListener) have both been added to simplify the callback process.
  • Public: createIntent(OnfidoConfig, int requestCode) has been added to replace createIntent(OnfidoConfig config)
Changed
  • Public: Face capture is now uploaded to the live photo endpoint, with validation included.
  • Public: createIntent(OnfidoConfig config) has been deprecated.
  • Public: Removed fabric, appsee and crashlytics.
  • Public: Replace the full google play services with just the vision module.
Removed
  • Public: The check is no longer initiated by the sdk.
    • extractCheckResult(Intent) has been removed
    • OnfidoConfig#withAsyncCheck(boolean) and Onfido#withSyncWaitTime(int) have been removed since they are related to check initiation
    • FlowStep.SYNC_LOADING has been removed as one of the possible steps.
  • Public: The deprecated withCustomFlow(FlowAction[]) has been removed

[0.2.2]

Changed
  • Internal: Upgraded onfido api wrapper to get a fix on document validation, due to an api signature change.

[0.2.1]

Changed
  • Internal: Camera resolution has been optimized. It now tries to capture a document with a height resolution of 720p. Before it was capturing the highest resolution available.

[0.2.0]

Added
  • Public: Documents are now validated when uploaded.
Changed
  • Internal: onfido-api-client was updated in order to use the document validation

[0.1.1]

Added
  • Capture Screen: Continuous Focus Mode is now always active.
  • Capture Screen: It's possible to trigger a manual auto focus cycle by tapping on the screen.
  • Capture Screen: A manual auto focus cycle is triggered before taking a picture.
  • Capture Screen: Added an exposure metering area equal to the rectangle that encompasses the overlay shape.
Fixed
  • Capture Screen: Corrected the size and ratio of the camera preview and improved its resolution, notable effect on the face capture screen.
  • Capture Screen: Removed copy that said an automatic capture would be triggered.
  • Fixed a crash bug that happened whenever the user pressed back going from the face to the document capture screen in one go.
  • Fixed a bug that did not permit the camera to be used by other apps when the sdk was running in the background.
Changed
  • Face Capture Screen: Increased the oval size and removed aliasing effect.

[0.1.0]

Added
  • Breaking: Fabric is now included in the library in order to log crashes, this might require changes in the build process.
  • Public: It's now possible to customize the SDK flow although with some restrictions.
  • Public: It' now possible to include customizable information screens anywhere in the flow.

[0.0.5]

Fixed
  • Build: Gradle script now supports proper publishing
  • UI: Date picker now has a max date
  • UI: Date picker style is now consistent with the other input fields (First and last name)
  • UI: Date format is now displayed according to the device regional settings
  • UI: Fixed the zooming of the face capture, it's now properly centered
  • UI: Fixed the button radius, changed it according to UI spec
Changed
  • Dependencies: Bumped the version of onfido-api-client to 0.3.5
Added
  • Build: Now supports local maven in order to test locally developed dependencies
  • Public: Made the NextActionListener interface public to allow clients to use the MessageFragment in their own code
  • UI: created a MessageDarkButtonStyle and two button backgrounds, dark and light