Overview
The Onfido Smart Capture SDKs provide a set of screens and functionalities that enable applications to implement user identity verification flows. Each SDK contains:
- Carefully designed UX to guide your customers through the different photo or video capture processes
- Modular design to help you seamlessly integrate the different photo or video capture processes into your application's 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
- A suite of advanced fraud detection signals to protect against malicious users
All Onfido Smart Capture SDKs are orchestrated using Onfido Studio workflows, with only minor customization differences between the available platforms.
The Onfido Android SDK is specifically designed for integrating Android applications.
Environments and testing with the SDK
Two environments exist to support the Onfido SDK integrations:
- 'sandbox' - to be used for testing with sample documents
- 'live' - to be used only with real documents and in production apps
The environment being used is determined by the API token that is used to generate the necessary SDK token.
Going Live
Once you are satisfied with your integration and are ready to go live, please contact client-support@onfido.com to obtain a live API token. You will have to replace the sandbox token in your code with the live token.
Check that you have entered correct billing details inside your Onfido Dashboard, before going live.
Adding the SDK dependency
The SDK supports API level 21 and above (refer to the distribution stats).
Version 7.4.0 of the SDK was the last version that supported API level 16 and above.
Our configuration is currently set to the following:
minSdkVersion = 21
targetSdkVersion = 31
android.useAndroidX=true
Kotlin = 1.7.10+
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
Starting from version 4.2.0
of the Android SDK, Onfido caters to different integration needs by offering a comprehensive "full" version, as well as a more lightweight "core" version. As such, you can integrate the SDK in one of two ways:
onfido-capture-sdk
onfido-capture-sdk-core
1. onfido-capture-sdk
This is the recommended integration option.
This is a complete solution, focusing on input quality. It features 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.
repositories { mavenCentral() } dependencies { implementation 'com.onfido.sdk.capture:onfido-capture-sdk:x.y.z' }
Due to the advanced validation support (in C++ code), we recommend that the integrator app performs multi-APK split to optimize the app size for individual architectures.
Average size (with Proguard enabled):
ABI | Size |
---|---|
armeabi-v7a | 13.30 Mb |
arm64-v8a | 13.25 Mb |
universal | 21.20 Mb |
2. onfido-capture-sdk-core
This is a lighter version. It provides a set of basic image validations, mostly completed on the backend. There are no real-time validations on-device for document capture. However, since our face capture utilizes NDK for advanced face recognition and yaw calculation, we still recommend multi-APK split to optimize the app size for individual architectures.
repositories { mavenCentral() } dependencies { implementation 'com.onfido.sdk.capture:onfido-capture-sdk-core:x.y.z' }
Average size (with Proguard enabled):
ABI | Size |
---|---|
core-armeabi-v7a | 10.19 Mb |
core-arm64-v8a | 9.97 Mb |
core-universal | 14.82 Mb |
Note: The average sizes were measured by building the minimum possible wrappers around our SDK, using the following stack. Different versions of the dependencies, such as Gradle or NDK, may result in slightly different values.
Note: To improve the security of our clients, our infrastructure and SDK client SSL configurations support TLSv1.2+ only. According to the relevant Google documentation, this support comes enabled by default on every device running Android API 20+. If you need to support older devices, we need to access Google Play Services to install the latest security updates which enable this support. If you don't use Google Play Services on your integration yet, we require you to add the following dependency:
compile ('com.google.android.gms:play-services-base:x.y.z') { exclude group: 'com.android.support' // to avoid conflicts with your current support library }
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 thisarm64-v8a
: 64-bit ARM processors. Found on new generation devicesx86
: Used by most tablets and emulatorsx86_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
to the following:
android { splits { abi { enable true reset() include 'x86', 'x86_64', 'arm64-v8a', 'armeabi-v7a' universalApk false } } }
Read the Android documentation for more information.
Note: To further reduce the footprint of the SDK beyond the lightweight onfido-capture-sdk-core
, you can integrate the Android SDK as a Dynamic Feature Module. You'll find more details about this in the dedicated section below.
Defining a workflow
Onfido Studio is the platform used to create highly reusable identity verification workflows for use with the Onfido SDKs. For an introduction to working with workflows, please refer to our Getting Started guide, or the Onfido Studio product guide.
SDK sessions are orchestrated by a session-specific workflow_run_id
, itself derived from a workflow_id
, the unique identifier of a given workflow.
For details on how to generate a workflow_run_id
, please refer to the POST /workflow_runs/
endpoint definition in the Onfido API reference.
Note that in the context of the SDK, the
workflow_run_id
property is referred to asworkflowRunId
.
Applicant ID reuse
When defining workflows and creating identity verifications, we highly recommend saving the applicant_id
against a specific user for potential reuse. This helps to keep track of users should you wish to run multiple identity verifications on the same individual, or in scenarios where a user returns to and resumes a verification flow.
SDK authentication
The SDK is authenticated using SDK tokens. As each SDK token must be specific to a given applicant and session, a new token must be generated each time you initialize the Onfido Android SDK.
For details on how to generate SDK tokens, please refer to POST /sdk_token/
definition in the Onfido API reference.
Note: You must never use API tokens in the frontend of your application as malicious users could discover them in your source code. You should only use them on your server.
tokenExpirationHandler
It's important to note that SDK tokens expire after 90 minutes.
With this in mind, we recommend you use the optional tokenExpirationHandler
parameter in the SDK token configuration function to generate and pass a new SDK token when it expires. This ensures the SDK continues its flow even after an SDK token has expired. You should inject a new token in 10 seconds after the callback is triggered, otherwise the flow will finish with a TokenExpiredException
error.
For example:
Kotlin
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` the sdk will exit with token expired error } } val config = OnfidoConfig.builder(context) .withSDKToken("<YOUR_SDK_TOKEN_HERE>", tokenExpirationHandler = ExpirationHandler()) // ExpirationHandler is optional
Java
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` the sdk will exit with token expired error } } OnfidoConfig.Builder config = new OnfidoConfig.Builder(context) .withSDKToken("<YOUR_SDK_TOKEN>", new ExpirationHandler()); // ExpirationHandler is optional
Custom Application Class
Note: You can skip this step if you don't have any custom application class.
Note: Following the release of version 17.0.0, the Android SDK runs in a separate process. This means that when the SDK gets started, a new application instance will be created. To prevent re-executing the initializations you have in the Android application class, you can use the isOnfidoProcess
extension function and return from onCreate
as shown below.
This will prevent initialization-related crashes such as: FirebaseApp is not initialized in this process
The isOnfidoProcess
extension function has been integrated into the Application class to prevent accidental reinitialization of instances within custom application classes. This feature is especially useful for optimizing the Onfido initialization process. Be aware that the Onfido process uses your custom Application class for its own initialization. If you decide to use isOnfidoProcess
to selectively skip the initialization of certain instances during the Onfido process, be cautious not to access these uninitialized instances elsewhere in your Application class, such as in the onTrimMemory
method, to avoid unexpected behavior. Furthermore, instances initialized by providers like Firebase will not be reinitialized in the Onfido process. If you wish to use such instances within the Onfido process, you'll need to manually initialize them. More info can be found here.
Dynamic Feature Module (Beta)
You can also integrate Onfido's Android SDK using a Dynamic Feature Module. The advantage of this configuration is that it reduces the SDK size to essentialy zero, as it is only initialized at run time.
To configure the Dynamic Feature Module, follow these steps:
- Create a Dynamic Feature module
- Import the Onfido SDK
onfido-workflow
oronfido-capture-sdk-core
as a library in the dynamic module- Customers can decide how the module will be installed and this won’t affect Onfido SDK behaviour
- Configure install-time delivery
- Configure conditional delivery
- Configure on-demand delivery
- Import the Onfido SDK API modules in your base-module (or any other module where you had Onfido configurations previously)
- For Onfido Studio
onfido-workflow-api
- For manual verification configuations only
onfido-public-api
- For Onfido Studio
- Before launching the Onfido SDK, make sure your dynamic feature is installed and ready to be used
- Launch the Onfido SDK normally. The API will take care of launching the SDK correctly, if the Workflow or Capture libraries are pulled in a Dynamic Feature Module
Appearance and Colors
You can customize colors and other appearance attributes by overriding Onfido themes (OnfidoActivityTheme
and OnfidoDarkTheme
) in your themes.xml
or styles.xml
files.
Make sure to set OnfidoBaseActivityTheme
as the parent of OnfidoActivityTheme
and OnfidoBaseDarkTheme
as the parent of OnfidoDarkTheme
in your style definition.
All colors referenced in the themes should be defined in your colors.xml
file. Alternatively, you can use hexadecimal
color values directly in the themes. When customizing fonts, all referenced fonts must be added to your project first.
Further instructions for adding fonts can be found in the Android documentation.
For example, you can add these themes to your themes.xml
to change the toolbar background and primary buttons'
color:
<!-- Light theme --> <style name="OnfidoActivityTheme" parent="OnfidoBaseActivityTheme"> <item name="onfidoColorToolbarBackground">@color/brand_dark_blue</item> <item name="onfidoColorActionMain">@color/brand_accent_color</item> </style> <!-- Dark theme --> <style name="OnfidoDarkTheme" parent="OnfidoBaseDarkTheme"> <item name="onfidoColorToolbarBackground">@color/brand_dark_blue</item> <item name="onfidoColorActionMain">@color/brand_accent_color</item> </style>
For a complete list and visualizations of the customizable attributes, refer to our SDK customization guide.
Dark theme
Starting from version 19.1.0, the Android SDK supports the dark theme. By default, the user's active device theme will be automatically applied to the Onfido SDK. However, you can opt out from dynamic theme switching at run time and instead set a theme statically at the build time as shown below. In this case, the flow will always be displayed in the selected theme regardless of the user's device theme.
To force select dark theme:
onfidoConfigBuilder.withTheme(OnfidoTheme.DARK)
To force select light theme:
onfidoConfigBuilder.withTheme(OnfidoTheme.LIGHT)
You can also automatically use the user's device theme:
onfidoConfigBuilder.withTheme(OnfidoTheme.AUTOMATIC)
Typography
You can customize the SDK's fonts by providing font XML resources to the theme by setting the OnfidoActivityTheme
attribute.
For example:
In your application's styles.xml
file:
<style name="OnfidoActivityTheme" parent="OnfidoBaseActivityTheme"> <item name="onfidoFontFamilyTitle">@font/montserrat_semibold</item> <item name="onfidoFontFamilyBody">@font/font_montserrat</item> <!-- You can also make the dialog buttons follow another fontFamily like a regular button --> <item name="onfidoFontFamilyDialogButton">?onfidoFontFamilyButton</item> <item name="onfidoFontFamilySubtitle">@font/font_montserrat</item> <item name="onfidoFontFamilyButton">@font/font_montserrat</item> <item name="onfidoFontFamilyToolbarTitle">@font/font_montserrat_semibold</item> </style>
Language localization
The Onfido SDK supports and maintains translations for over 40 languages.
To configure a specific localization, you can use the withLocale(Locale)
method of the OnfidoConfig.Builder
to select a language. For example, to configure for French:
final OnfidoConfig config = OnfidoConfig.builder() .withLocale(fr) .build();
Note: If no language is selected, the SDK will detect and use the end user's device language setting. If the device's language is not supported, the SDK will default to English (en_US
).
For the full list of languages supported by Onfido, please refer to our SDK customization guide.
Custom language
The Android SDK also allows for the selection of a specific custom language for locales that Onfido does not currently support. You can have an additional XML strings file inside your resources folder for the desired locale (for example, res/values-it/onfido_strings.xml
for 🇮🇹 translation), with the content of our strings.xml file, translated for that locale.
When adding custom translations, please make sure you add the whole set of keys we have on strings.xml.
Note: If the strings translations change, it will result in a minor version change. If you have custom translations, you're responsible for testing your translated layout.
If you want a locale translated, you can get in touch with us at android-sdk@onfido.com.
NFC capture using Onfido Studio
Recent passports, national identity cards and residence permits contain a chip that can be accessed using Near Field Communication (NFC). The Onfido SDKs provide a set of screens and functionalities to extract this information, verify its authenticity and provide the resulting verification as part of a Document report.
From version 18.1.0 onwards of the Onfido Android SDK, NFC is enabled by default and offered to end users when both the document and the device support NFC.
For more information on how to configure NFC and the list of supported documents, please refer to the NFC for Document Report guide.
Handling callbacks
When the Onfido SDK session concludes, a range of callback functions may be triggered.
For advanced callbacks used for user analytics and returning submitted media, please refer to the Advanced Callbacks section of this document.
Available callback functions include:
Attribute | Notes |
---|---|
onUserCompleted | Callback that fires when all interactive tasks in the workflow have been completed. If you have configured webhooks, a notification will be sent to your backend confirming the workflow run has finished. You do not need to create a check using your backend as this is handled directly by the workflow. |
onUserExited | Callback that fires when the workflow was exited prematurely by the user. The reason can be an exitCode, e.g USER_CONSENT_DENIED . |
onException | In case of an unexpected error, the onException method will be invoked with a relevant error message in the WorkflowException object. Error messages are not in a presentable format to the end user and are not localized. |
To receive the result from the flow, you should override the method onActivityResult
on your Activity or Fragment. The following code is provided as an example:
Kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { onfidoWorkflow.handleActivityResult(resultCode, data, object : OnfidoWorkflow.ResultListener { override fun onUserCompleted() { // Called when the entire workflow run has reached the terminal node. } override fun onUserExited(exitCode: ExitCode) { // Called when the user has exited the flow before reaching the terminal node. } override fun onException(exception: OnfidoWorkflow.WorkflowException) { // Called when the flow has ended with an exception } }) }
Generating verification reports
While the SDK is responsible for capturing and uploading the user's media and data, identity verification reports themselves are generated based on workflows created using Onfido Studio.
For a step-by-step walkthrough of creating an identity verification using Onfido Studio and our SDKs, please refer to our Quick Start Guide.
If your application initializes the Onfido Android SDK using the options defined in the Advanced customization section of this document, you may create checks and retrieve report results manually using the Onfido API. You may also configure webhooks to be notified asynchronously when the report results have been generated.
Advanced flow customization
This section on 'Advanced customization' refers to the process of initializing the Onfido Android SDK without the use of Onfido Studio. This process requires a manual definition of the verification steps and their configuration.
The FlowStep
parameter is mutually exclusive with workflowRunId
, requiring an alternative method of instantiating the client and starting the flow.
Note that this initialization process is not recommended as the majority of new features are exclusively released for Studio workflows.
Start the flow
You can then use the client object to start the flow:
// start the flow. 1 should be your request code (customize 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 identify the onfido callback*/ config);
Flow customization
You can customize the flow of the SDK via the withCustomFlow(FlowStep[])
method. You can add, remove and shift around steps of the SDK flow.
The possible flow steps include:
Step | Description |
---|---|
FlowStep.WELCOME | Welcome screen shown to the user with preliminary instructions. Customization options include modification to the text elements and instructions shown to the user. |
FlowStep.CAPTURE_DOCUMENT | Set of screens that control the capture via photo of the user's document. Numerous customization options are available to define the document list presented to the user and the overall capture experience. |
FlowStep.CAPTURE_FACE | Set of screens that control the capture of a selfie, video or motion of the user. The customization options allow the selection of the capture variant. |
FlowStep.PROOF_OF_ADDRESS | Screen where the user selects the issuing country and type of document that verifies their address. |
FlowStep.FINAL | Screen shown to the user at the end of the flow. Customization options include modifications to the text elements shown to the user. |
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.PROOF_OF_ADDRESS, //Proof of address capture step FlowStep.FINAL //Final screen step, optional }; final OnfidoConfig config = OnfidoConfig.builder() .withCustomFlow(defaultStepsWithWelcomeScreen) .withSDKToken("<YOUR_SDK_TOKEN>") .build();
Exiting the flow
You can call the exitWhenSentToBackground()
method of the OnfidoConfig.Builder
, to automatically exit the flow if the user sends the app to the background.
This exit action will invoke the userExited(ExitCode exitCode)
callback.
Consent step
This step contains the consent language required when you offer your service to US users, as well as links to Onfido's policies and terms of use. For applicants created with a location
parameter value of the United States, consent collection is mandatory.
The user must click "Accept" to move past this step and continue with the flow. The content is available in English only, and is not translatable.
Note: This step does not automatically inform Onfido that the user has given their consent:
- When creating checks using API v3.3 or lower, you need to set the value of the API parameter
privacy_notices_read_consent_given
(now deprecated) at the end of the SDK flow when creating a check - From API v3.4 onwards, user consent is confirmed when creating or updating an applicant using the consents parameter
If you choose to disable Onfido’s SDK Consent step, you must still incorporate the required consent language and links to Onfido's policies and terms of use into your own application's flow before your users start interacting with the Onfido SDK.
For more information about this step, and how to collect user consent, please visit Onfido Privacy Notices and Consent.
Document capture step
In the Document Capture step, an end user can select the issuing country and document type before capture. In a very limited number of cases, the end user may also be asked if they have a card or paper version of their document.
This information is used to optimize the capture experience, as well as inform the end user about which documents they are allowed to use.
This selection screen is dynamic, and will be automatically hidden where the end user is not required to indicate which document will be captured.
You can specify allowed issuing countries and document types for the document capture step in one of three ways:
- If you are using Onfido Studio, this is configured within a Document Capture task, documented in the Studio Product Guide
- Otherwise, the recommended approach is to apply this configuration globally in your Dashboard under Accounts \ Supported Documents, or hard code it into your SDK integration. Both of these options are documented below.
Country and document type selection by Dashboard
Configuring the issuing country and document type selection step using your Dashboard is the recommended method of integration (available from iOS SDK version 28.0.0 and Android SDK version 16.0.0 onwards), as this configuration is also applied to your Document Reports. Any document that has been uploaded by an end user against your guidance will result in a Document Report sub-result of "rejected" and be flagged as Image Integrity
> Supported Document
.
We will be rolling out Dashboard-based configuration of allowed documents soon. In the meantime, contact support@onfido.com or your Customer Support Manager to request access to this feature.
- Open the Accounts tab on your Dashboard, then click Supported Documents
- You will be presented with a list of all available countries and their associated supported documents. Make your selection, then click Save Change.
Please note the following SDK behaviour:
- Hard coding any document type and issuing country configuration in your SDK integration will fully override the Dashboard-based settings
- Currently, only passport, national ID card, driving licence and residence permit are visible for document selection by the end user in the SDK. For the time being, if you nominate other document types in your Dashboard (visa, for example), these will not be displayed in the user interface
- If you need to add other document types to the document selection screen, you can mitigate this limitation in the near-term, using the Custom Document feature
- If for any reason the configuration fails or is not enabled, the SDK will fallback to display the selection screen for the complete list of documents supported within the selection screens
Country and document type customization by SDK integration code
You can configure the document step to capture single document types with specific properties, as well as customize the screen to display only a limited list of document types using the DocumentCaptureStepBuilder
class's functions for the corresponding document types.
Document Type | Configuration function | Configurable Properties |
---|---|---|
Passport | forPassport() | |
National Identity Card | forNationalIdentity() | - country - documentFormat |
Driving Licence | forDrivingLicence() | - country - documentFormat |
Residence Permit | forResidencePermit() | - country |
Visa | forVisa() | - country |
Work Permit | forWorkPermit() | - country |
Generic | forGenericDocument() | - country - documentPages |
Note: GENERIC
document type doesn't offer an optimized capture experience for a desired document type.
- Document type
The list of document types visible for the user to select can be shown or hidden using this option. If only one document type is specified, users will not see the selection screen and will be taken directly to the capture screen.
Each document type has its own configuration class.
Customizing the issuing country and document type selection screen with pre-selected documents
You can also customize the screen to display only a limited list of document types, using the configuration function to specify the ones you want to show.
Note: Currently you can only include PASSPORT
, NATIONAL_IDENTITY_CARD
, DRIVING_LICENCE
, RESIDENCE_PERMIT
in the list.
For example, to hide the Driving Licence Document type:
Kotlin
val documentTypes = listOf( DocumentType.PASSPORT, DocumentType.NATIONAL_IDENTITY_CARD, DocumentType.RESIDENCE_PERMIT ) onfidoConfigBuilder.withAllowedDocumentTypes(documentTypes)
- Document country
The configuration function allows you to specify the document's country of origin. If a document country is specified for a document type, the selection screen is displayed with the preselected country.
Note: You can specify a 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.
For example, to only capture UK driving licences:
Kotlin
val drivingLicenceCaptureStep = DocumentCaptureStepBuilder.forDrivingLicence() .withCountry(CountryCode.GB) .build()
- Document format
You can specify the format of a document as CARD
or FOLDED
. CARD
is the default document format value for all document types.
If FOLDED
is configured, a specific template overlay is shown to the user during document capture.
Note: You can specify FOLDED
document format for French driving licence, South African national identity and Italian national identity only. If you configure the SDK with an unsupported
document format, the SDK will throw a InvalidDocumentFormatAndCountryCombinationException
.
For example to only capture folded French driving licences:
Kotlin
val drivingLicenceCaptureStep = DocumentCaptureStepBuilder.forDrivingLicence() .withCountry(CountryCode.FR) .withDocumentFormat(DocumentFormat.FOLDED) .build()
Note: Not all document-country combinations are supported. 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.
A complete list of all supported documents can be found here.
Face capture step
In this step, a user can use the front camera to capture their face in the form of a selfie photo, video or motion capture.
The Face step has 3 variants:
- To configure for photo, use
FaceCaptureStepBuilder.forPhoto()
- To configure for video, use
FaceCaptureStepBuilder.forVideo()
- To configure for motion, use
FaceCaptureStepBuilder.forMotion()
Motion
Motion supports audio recording, but it is disabled by default. In order to enable it use .withAudio(true)
.
FlowStep faceCaptureStep = FaceCaptureStepBuilder.forMotion() .withAudio(true) .build();
Introduction screen
By default, all variants show an introduction screen. This is an optional screen only for the photo variant. You can disable it using the withIntro(false)
function.
FlowStep faceCaptureStep = FaceCaptureStepBuilder.forPhoto() .withIntro(false) .build();
Please note that you can only hide the intro video (not the whole screen) in the video variant by using the withIntro(false)
function.
Customization of the introduction screen for the motion variant is not available.
Confirmation screen
By default, both photo and video variants show a confirmation screen. To not display the recorded video on the confirmation screen, you can hide it using the withConfirmationVideoPreview
function.
FlowStep faceCaptureStep = FaceCaptureStepBuilder.forVideo() .withConfirmationVideoPreview(false) .build();
Errors
The Face step can be configured to allow for only one variant. A custom flow cannot contain multiple variants of the face capture. If more than one type of FaceCaptureStep
are added to the same custom flow, a custom IllegalArgumentException
will be thrown at the beginning of the flow,
with the message "You are not allowed to define more than one FaceCaptureVariant in a flow."
.
NFC capture
Recent passports, national identity cards and residence permits contain a chip that can be accessed using Near Field Communication (NFC). The Onfido SDKs provide a set of screens and functionalities to extract this information, verify its authenticity and provide the results as part of a Document report.
With version 18.1.0 of the Onfido Android SDK, NFC is enabled by default and offered to end users when both the document and the device support NFC.
For more information on how to configure NFC and the list of supported documents, please refer to the NFC for Document Report guide.
Disabling NFC and excluding dependencies
As NFC is enabled by default and library dependencies are included in the build automatically, the following section details the steps required to disable NFC and remove any libraries from the build process:
Call disableNFC()
while configuring OnfidoConfig
:
val config = OnfidoConfig.builder(this@MainActivity) .withSDKToken(“<YOUR_SDK_TOKEN_HERE>”) .disableNFC() //Disable NFC feature .withCustomFlow(flowSteps) .build()
Exclude dependencies required for NFC from your build:
dependencies { implementation 'com.onfido.sdk.capture:onfido-capture-sdk:x.y.z' { exclude group: 'net.sf.scuba', module: 'scuba-sc-android' exclude group: 'org.jmrtd', module: 'jmrtd' exclude group: 'com.madgag.spongycastle', module: 'prov' } }
If your application already uses the same libraries that the Onfido SDK needs for the NFC feature, you may encounter some dependency conflicts that will impact and could interfere with the NFC capture in our SDK. In such cases, we propose using the dependency resolution strategy below, by adding the following lines to your build.gradle
file:
implementation ("com.onfido.sdk:onfido-<variant>:19.1.0"){ exclude group: "org.bouncycastle" } implementation ("the other library that conflicts with Onfido on BouncyCastle") { exclude group: "org.bouncycastle" } implementation "org.bouncycastle:bcprov-jdk15to18:1.69" implementation "org.bouncycastle:bcutil-jdk15to18:1.69"
Handling callbacks
When the Onfido SDK session concludes, a range of callback functions may be triggered.
To receive the result from the flow, you should override the method onActivityResult
on your Activity or Fragment. Typically, on success, you would create a check on your backend server.
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { ... onfido.handleActivityResult(resultCode, data, new Onfido.OnfidoResultListener() { @Override public void userCompleted(Captures captures) { } @Override public void userExited(ExitCode exitCode) { } @Override public void onError(OnfidoException exception) { } }); }
Available callback functions include:
Attribute | Notes |
---|---|
userCompleted | User completed the flow. You can now create a check on your backend server. The captures object contains information about the document and face captures made during the flow. |
userExited | User left the SDK flow without completing it. Some images may have already been uploaded. The exitCode object contains information about the reason for exit. |
onError | User couldn't complete the flow because some error occurred. |
captures
Sample of a captures
instance returned by a flow with FlowStep.CAPTURE_DOCUMENT
, FlowStep.CAPTURE_FACE
and FlowStep.PROOF_OF_ADDRESS
:
Document: Front: DocumentSide(id=document_id, side=FRONT, type=DRIVING_LICENCE, nfcSupported=false) Back: DocumentSide(id=document_id, side=BACK, type=DRIVING_LICENCE, nfcSupported=false) Type: DRIVING_LICENCE Face: Face(id=face_id, variant=PHOTO) Proof of address: Poa(id=poa_id, type=UTILITY_BILL, issuing_country=UK)
Note: the type
property refers to DocumentType
, variant refers to FaceCaptureVariant
Note: As part of the userCompleted
method, the DocumentType
property can only contain the values which are supported by the Onfido API. Please refer to our API documentation
exitCode
Potential exitCode
reasons include:
exitCode |
---|
USER_LEFT_ACTIVITY |
USER_CONSENT_DENIED |
REQUIRED_NFC_FLOW_NOT_COMPLETED |
CAMERA_PERMISSION_DENIED (Deprecated) |
Introduction
Custom media callbacks allow you to control the data collected by the Onfido SDK by using callbacks that are invoked when the end user submits their captured media. The callbacks provide all of the information that would normally be sent directly to the Onfido API and expect a promise in response, controlling what the SDK does next.
As a result, you can leverage Onfido's advanced on-device technology, including image quality validations, while still being able to handle end users’ data directly. This unlocks additional use cases, including compliance requirements and multi-vendor configurations, that require this additional flexibility.
Java
onfidoConfigBuilder.withMediaCallback(new CustomMediaCallback()); private static class CustomMediaCallback implements MediaCallback { @Override public void onMediaCaptured(@NonNull MediaResult result) { if (result instanceof DocumentResult) { // Your callback code here } else if (result instanceof LivenessResult) { // Your callback code here } else if (result instanceof SelfieResult) { // Your callback code here } } }
User data
The callbacks return an object including the information that the SDK normally sends directly to the Onfido API. The callbacks are invoked when the end user confirms submission of their image through the SDK’s user interface.
Note: Currently, end user data will still automatically be sent to the Onfido backend. You are not required to use Onfido to process this data.
Documents
For documents, the callback returns a DocumentResult
object:
{ fileData: MediaFile documentMetadata: DocumentMetadata }
The DocumentMetadata
object contains the metadata of the captured document.
{ side: String, type: String, issuingCountry: String }
Note: issuingCountry
is optional based on end-user selection, and can be null
Note: If a document was scanned using NFC, the callback will only return the MediaFile
Live photos and videos
For live photos, the callback returns a SelfieResult
object:
{ fileData: MediaFile }
For live videos, the callback returns a LivenessResult
object:
{ fileData: MediaFile }
The MediaFile
object contains the raw data, file type and the file name of the captured photo or video.
{ fileData: ByteArray, fileType: String, fileName: String }
Java
// Place your listener in a separate class file or make it a static class class OnfidoEventListener implements OnfidoAnalyticsEventListener { private final Context applicationContext; private final Storage storage; OnfidoEventListener(Context applicationContext, Storage storage) { this.applicationContext = applicationContext; this.storage = storage; } @Override public void onEvent(@NonNull OnfidoAnalyticsEvent event) { // Your tracking or persistence code // You can persist the events to storage and track them once the SDK flow is completed or exited with an error // This approach can help to scope your potential network calls to the lifecycle of your activity or fragment // storage.addToList("onfidoEvents", event); } } private static final int ONFIDO_FLOW_REQUEST_CODE = 100; OnfidoConfig onfidoConfig = OnfidoConfig.builder(applicationContext) .withAnalyticsEventListener(new OnfidoEventListener(applicationContext, storage)) .build(); Onfido.startActivityForResult(this, ONFIDO_FLOW_REQUEST_CODE, onfidoConfig);
Kotlin
// Place your listener in a separate class file class OnfidoEventListener( private val applicationContext: Context, private val storage: Storage ) : OnfidoAnalyticsEventListener { override fun onEvent(event: OnfidoAnalyticsEvent) { // Your tracking or persistence code // You can persist the events to storage and track them once the SDK flow is completed or exited with an error // This approach can help to scope your potential network calls to the lifecycle of your activity or fragment // storage.addToList("onfidoEvents", event) } } companion object { private const val ONFIDO_FLOW_REQUEST_CODE = 100 } val onfidoConfig = OnfidoConfig.builder(applicationContext) .withAnalyticsEventListener(new OnfidoEventListener(applicationContext, storage)) .build() Onfido.startActivityForResult(this, ONFIDO_FLOW_REQUEST_CODE, onfidoConfig)
The code inside the overridden method will now be called when a particular event is triggered, usually when the user reaches a new screen. Please use a static or separate class instead of a lambda or an anonymous inner class to avoid leaking the outer class, e.g. Activity or Fragment. Also refrain from using Activity or Fragment context references in your listener to prevent memory leaks and crashes. If you need access to a context object, you can inject your application context in the constructor of your listener as shown in the above example. As a better approach, you can wrap your application context in a single-responsibility class (such as Storage
or APIService
) and inject it in your listener, as shown in the example.
Notes:
- From versions 16.0.0 onwards,
UserEventHandler
has been deprecated and removed from the SDK. If you are upgrading from a previous Onfido SDK version, please migrate toOnfidoAnalyticsEventListener
- From version 18.0.0 onwards, for any usage of the
OnfidoEventListener
, implementParcelable
instead ofSerializable
For a full list of events, see TRACKED_EVENTS.md.
property | description |
---|---|
type | OnfidoAnalyticsEventType Indicates the type of event. Potential values (enum instances) are FLOW , SCREEN , VIEW , ACTION , ERROR . |
properties | Map<OnfidoAnalyticsPropertyKey, String?> Contains details of an event. For example, you can get the name of the visited screen using the SCREEN_NAME property. The current potential property keys are: SCREEN_NAME , SCREEN_MODE , DOCUMENT_TYPE , COUNTRY_CODE , DOCUMENT_FORMAT , VIDEO_CHALLENGE_TYPE and IS_AUTOCAPTURE . |
Properties
SCREEN_NAME
: The name of the visited screen (e.g.WELCOME
,DOCUMENT_CAPTURE
, etc.)SCREEN_MODE
: Screen orientation in json, potential values areportrait
orlandscape
DOCUMENT_TYPE
: Type of the selected document for capture (e.g.passport
,national_id
,driving_licence
, etc.)COUNTRY_CODE
: The 2-letter ISO code of the selected country (e.g.US
,UK
,DE
, etc.), used in theCOUNTRY_SELECTION
eventDOCUMENT_FORMAT
: Format of the document to capture, used in theDOCUMENT_CAPTURE
event. Possible values arecard
andfolded
VIDEO_CHALLENGE_TYPE
: Type of the displayed liveness video challenge (e.g.recite
,movement
)IS_AUTOCAPTURE
: Whether or auto-capture was used
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 issues or questions about the existing integrations should be raised on the corresponding repository and questions about further integrations should be sent to android-sdk@onfido.com.
Migrating
You can find the migration guide in the MIGRATION.md file.
Certificate Pinning
You can pin any communication between our SDK and server through the .withCertificatePinning()
method in
our OnfidoConfig.Builder
configuration builder. This method accepts as a parameter an Array<String>
with sha-1/sha-256 hashes of the certificate's public keys.
For more information about the hashes, please email android-sdk@onfido.com.
Accessibility
The Onfido Android SDK has been optimized 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.
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.
API Documentation
Further information about the Onfido API is available in our API reference.
Support
Should you encounter any technical issues during integration, please contact Onfido's Customer Support team via email, including the word ISSUE at the start of the subject line.
Alternatively, you can search the support documentation available via the customer experience portal, public.support.onfido.com.
We recommend you update your SDK to the latest version release as frequently as possible. Customers on newer versions of the Onfido SDK consistently see better performance across user onboarding and fraud mitigation, so we strongly advise keeping your SDK integration up-to-date.
You can review our full SDK versioning policy here.
Copyright 2024 Onfido, Ltd. All rights reserved.
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
Fixed
- Fixed upload error for Kosovo documents
- Fixed an accessibility issue in the Country selection screen, where the 'Can't find your country' button used to behave incorrectly
- Fixed the Search icon not visible in dark mode
- Fixed a crash at SDK initialization time for customers using WebViews and initializing their directory inside the onCreate method of the Application class
- Added a ContentProvider so that the initialization of the Onfido process happens earlier than any other potential Android component
- Fixed
IllegalStateException
when launching SDK - Fixed displaying problems with the "Invalid file" dialog in the Proof of Address flows
- Fixed Liveness back navigation
- Fixed hidden non functional back button in studio flows
- Fixed crash in Motion Upload screen when recovered from process death
- Fixed accessibility issues around focus for TalkBack navigation
- Enabled Accessibility system wide set font sizes on camera screen texts
Changed
- Separated Onfido SDK and Workflow APIs to onfido-public-api and onfido-workflow-api respectively, with no API or integration change
- Updated documentation on how to integrate and use the SDK as a Dynamic Feature Module
- Improved Resolution Selection Algorithm
- Removed dfm-base module and merged it with onfido-public-api
Fixed
- Enhanced the stability of the SDK during initial startup and when resuming after being in the background. This update ensures a smoother, more reliable experience both when launching the app and returning to it after multitasking.
- Fixed Camera lifecyle related issues
- Fixed broken theme after restoring state in document selection screen
Added
- Expanded Studio to support the integration of Qualified Electronic Signature (QES) and One-Time Password (OTP) capture steps
- Added an uploading view while uploading Proof of Address documents
- Added Proguard rules for Retrofit to support R8 full mode according to the R8 FAQ
- Added
dontwarn
for our internal dagger shadow classes to Proguard rules - Added a new sample app in Kotlin
Fixed
- Forced and lowered the
kotlinx-serialization-json
library version to1.3.1
to be more compatible for customer integrators using lower versions - Fixed unmute button height animation in Video capture confirmation screen
- Fixed flow termination when user clicks cancel during NFC scanning process
- Fixed an issue with the Submit button being visible on document confirmation screen when image quality error is returned for the first time
- Fixed a Studio issue where, in case the capture was cancelled by the user, the
onError
callback was being triggered instead ofuserExited
in a specific navigation scenario - Fixed a Studio issue where the workflow-run-id was kept between successive executions of the same workflow
- Fixed NPE occurring during
isOnfidoProcess
check - Fixed crashes during the Proof of Address capture
- Fixed missing translation for voice-over text on selfie preview screen
- Fixed infinite loading after document capture when the SDK is sent to the background
Fixed
- Fixed flow termination when user clicks cancel during NFC scanning process
- Fixed an issue with the Submit button being visible on document confirmation screen when image quality error is returned for the first time
- Forced and lowered the
kotlinx-serialization-json
library version to1.3.1
to be more compatible for customer integrators using lower versions. - Fixed a Studio issue where the workflow-run-id was kept between successive executions of the same workflow
Fixed
- Fixed a Studio issue where the workflow-run-id was kept between successive executions of the same workflow
- Fixed a flow termination issue when the user clicked on Cancel during the NFC scanning process
- Fixed an issue with the Submit button being visible on document confirmation screen when image quality error is returned for the first time
Added
- Introduced
withTheme(theme)
which enables you to either force set a dark/light theme, or follow the device’s system setting. More details can be found here - Added theme selection to Onfido SDK's public APIs
Fixed
- Fixed last two countries in the countries list are not visible
- Fixed the BadTokenException crashes that occurred when users moved the app to the background while capturing
- Fixed the crash occurs when decoding bitmap
- Fixed the Fatal 6 signal error after the document capture
- Fixed
IllegalArgumentException
crash occurring during image cropping operations - Fixed 'CameraDevice was already closed' crashes, occurring when leaving the camera screen right after opening it
- Fixed infinite loop issue on document capture with Redmi phones
Added
- Payload signing for Selfie and Liveness 1.0 (aka Video)
- Updated Consent screen. Disabled Accept and Reject buttons until the consent is read
- Added
isOnfidoProcess
extension function to the Application class to prevent reinitialization in the custom application classes. More info here
Changed
- Remove
Parcelable
implementation fromOnfidoAnalyticsEventListener
and run it in the same process with the application. - Remove
Parcelable
implementation fromTokenExpirationHandler
and run it in the same process with the application. - Remove
Parcelable
implementation fromMediaCallback
and run it in the same process with the application - Deprecated
withNFCReadFeature()
inOnfidoConfig
- Enabled NFC by default in
OnfidoConfig
. AddeddisableNFC()
for disabling it - Remove Document Liveness deprecated feature
- Update supported locals in public documentation
- Update OpenCV library version to 4.7.0
- Add all translations to github public documentation
Fixed
- Fixed a crash on foldable devices upon finishing Video/Liveness recording
- Fixed undefined 'onfidoFontFamilyBody' attribute in 'OnfidoBaseActivityTheme' by adding a default value
- Fixed the custom language selection issue
- Fixed weird toolbar icon that appears in loading and consent screens
- Reverted orientation mode to portrait mode
Added
- After the release of version 17.0.0, Onfido Android SDK runs in a separate process. This means that when the callback is triggered, the body of that callback will run in Onfido SDK process rather than the main application process. Therefore, any actions performed in the callback, such as accessing memory or modifying UI, will be executed within the SDK process. It is important to keep this in mind when designing and implementing callbacks in order to ensure the proper functioning and performance of the SDK. - After the release of version 17.0.0, Onfido Android SDK runs in a separate process. This means that when the callback is triggered, the body of that callback will run in the Onfido SDK process rather than the main application process. Therefore, any actions performed in the callback, such as accessing memory or modifying UI, will be executed within the SDK process. It is important to keep this in mind when designing and implementing callbacks in order to ensure the proper functioning and performance of the SDK. Having Onfido SDK run in its own process adds extra reliability to customer applications as it avoids crashes on the customer app. It also brings better error logging support.
- Add explicit support for the Nynorsk language
Changed
- Handle audio and mic conflicts if there is audio playing or if the mic is in use when we start recording
- Added translations for audio in Motion strings
- Updated MLKit Face Detection library
- Added a MLKit Face Detection Module check in addition to the Google Play Services check in order to fallback to Selfie/Video
- Updated the supported document file to include Honduras National ID
Changed
- Removed depreceated UserEventHandler. Please use OnfidoConfig.builder(context).withAnalyticsEventListener().
- Improve picture frame selection algorithm
- Added user analytics listener to WorkflowConfig builder. Similar to the normal flow, you can now attach your analytics listener to your config using WorkflowConfig.builder(context).withAnalyticsEventListener(listener).
Changed
- Implemented a new enhanced resolution selection algorithm to take document photos with a better resolution.
- Improved camera focus. Our camera implementation now waits for the camera to focus before taking the document photo to prevent having blurry photos.
- Fixed displaying photo captured feedback too early. This issue was misguiding users so that they were moving their document or their device away while the photo capture was in progress.
- Increased image compression quality parameter.
- Disabled photo cropping for foldable devices to prevent having improperly cropped document images.
Changed
- Implemented a new enhanced resolution selection algorithm to take document photos with a better resolution.
- Improved camera focus. Our camera implementation now waits for the camera to focus before taking the document photo to prevent having blurry photos.
- Fixed displaying photo captured feedback too early. This issue was misguiding users so that they were moving their document or their device away while the photo capture was in progress.
- Increased image compression quality parameter.
- Disabled photo cropping for foldable devices to prevent having improperly cropped document images.
Changed
- Implemented a new enhanced resolution selection algorithm to take document photos with a better resolution.
- Improved camera focus. Our camera implementation now waits for the camera to focus before taking the document photo to prevent having blurry photos.
- Fixed displaying photo captured feedback too early. This issue was misguiding users so that they were moving their document or their device away while the photo capture was in progress.
- Increased image compression quality parameter.
- Disabled photo cropping for foldable devices to prevent having improperly cropped document images.
[15.0.0] - 2022-12-16
Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md
Fixed
- Fixed
ClassCastException
when Camera not found - Fixed an issue where the capture screen seems frozen after the app is sent to background and resumed
- Fixed the IllegalStateException crash, which occurs during navigation
- Fixed the NPE crash, which occurs during stopping the camera recording
- Fixed the crash when MLKit models cannot be downloaded. If this is the case we now detect this, and skip the validation.
- Fixed a bug where the capture button is displayed on top of the confirmation screen buttons
- Fixed Exif data related crashes
Fixed
- Fixed Exif data related crashes
- Fixed the IllegalStateException crash, which occurs during navigation
- Fixed the NPE crash, which occurs during stopping the camera recording
- Fixed the crash when MLKit models cannot be downloaded. If this is the case we now detect this, and skip the validation.
- Fixed
ClassCastException
when Camera not found
Changed
- Combined country and document type selection in one single screen (country first, document type second)
- Updated supported documents (Zambia NIC added, Albania Residence Permits removed, others)
- Introduced a new analytics event listener and deprecated the legacy UserEventHandler
- Disabled some functionalities that require Google Play Service when Google Play Service is unavailable
Changed
- Removed the option to implement the user consent screen directly in your configuration during SDK initialization. It is now controlled by the Onfido backend. Please see our Onfido privacy notices and consent migration guide for further information.
Changed
- Improved auto-capture performance
- Added
withNFCReadBetaFeature()
toOnfidoConfig.Builder
for enabling NFC - Removed traces of old support library references
- Marked extension functions as internal to avoid polluting integrators' namespace
- Onfido SDK now is built using Android Gradle Plugin 7.0.3
- Added NFC integration documentation
Fixed
- UI: Fixed issue that liveness digit challenge does not have delay before button appears
- Fixed crash issue -
NullPointerException: volumeView
must not benull
- UI: Fixed issue that
exitWhenSentToBackground
exits flow when it switches from front of document to back of document - Excluded META-INF/com.google.dagger_dagger.version from being packaged inside Onfido SDK
- Made microphone feature optional
Changed
- Added
MissingOnfidoConfigException
error message ifOnfidoConfig
is not specified when starting the flow - Applied new watermark position at the bottom of all screens
- Upgraded Kotlin version to v1.5.21
- Changed analytic event for passport from DOCUMENT_CAPTURE_FRONT to DOCUMENT_CAPTURE
- UI: Made live and post-capture alerts align to the top of the frame
- Implemented disabling mobile SDK analytics as an enterprise feature
- Migrated from RxJava 2 to RxJava 3
- Upgraded to AppCompat version 1.3.1
- Enabled R8
Changed
- UI: Split head turn instructions into 2 lines, with the arrow in between
- UI: Integrated image quality service
- UI: Improved designs and copies across the SDK. Please visit our MIGRATION.md for the copy updates
- Removed deprecated methods and constructors of DocumentType class
- UI: Removed timer icon from subtitle in welcome screen
- UI: Properly set titles as accessibility headings
- Live capture warnings like "Glare detected" shouldn't steal focus from the user's current selection during Voice Over or Accessibility mode
- UI: Existing strings have been updated and new ones have been added. For more information, please visit our MIGRATION.md
- UI: Screen reader should read back button with screen title
- UI: Made country selection list items to be treated as buttons
Fixed
- Fixed low image quality issue that was happening on certain Xiaomi devices
- Fixed disappearing passport capture instruction text during on device validations
- Fixed a bug that was not triggering VIDEO_FACIAL_CAPTURE_STEP_0, VIDEO_FACIAL_CAPTURE_STEP_1 events in UserEventHandler during face liveness flow
Changed
- Added
MissingOnfidoConfigException
error message ifOnfidoConfig
is not specified when starting the flow - Applied new watermark position at the bottom of all screens
- Upgraded Kotlin version to v1.5.21
- Changed analytic event for passport from DOCUMENT_CAPTURE_FRONT to DOCUMENT_CAPTURE
- UI: Made live and post-capture alerts align to the top of the frame
- Implemented disabling mobile SDK analytics as an enterprise feature
- Migrated from RxJava 2 to RxJava 3
- Upgraded to AppCompat version 1.3.1
- Enabled R8
Changed
- UI: Split head turn instructions into 2 lines, with the arrow in between
- UI: Integrated image quality service
- UI: Improved designs and copies across the SDK. Please visit our MIGRATION.md for the copy updates
- Removed deprecated methods and constructors of DocumentType class
- UI: Removed timer icon from subtitle in welcome screen
- UI: Properly set titles as accessibility headings
- Live capture warnings like "Glare detected" shouldn't steal focus from the user's current selection during Voice Over or Accessibility mode
- UI: Existing strings have been updated and new ones have been added. For more information, please visit our MIGRATION.md
- UI: Screen reader should read back button with screen title
- UI: Made country selection list items to be treated as buttons
Fixed
- Fixed low image quality issue that was happening on certain Xiaomi devices
- Fixed disappearing passport capture instruction text during on device validations
- Fixed a bug that was not triggering VIDEO_FACIAL_CAPTURE_STEP_0, VIDEO_FACIAL_CAPTURE_STEP_1 events in UserEventHandler during face liveness flow
Added
- Added an option to hide the recorded video on the confirmation screen. For more information, please visit our README
Changed
- Renamed most of the localisation keys. Now, names are more explicit in which screens they are being used. Please visit our MIGRATION.md
- Remove duplication in the README file
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
Changed:
- Now using API v3 for communication with the backend
- Internal: Extended basic device information logging to all relevant API requests
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 - Fixed localization problems on liveness instructions
- Fixed supported folded document types explanation on README
- Fixed a bug that threw
InvalidDocumentFormatAndCountryCombinationException
onNationalIdentityCaptureStepBuilder
andDrivingLicenceCaptureStepBuilder
when configured with country code and document format except CountryCode.FR and CountryCode.IT - Fixed a bug that was causing sending not supported document type property to the Onfido backend.
Added:
- Added
Fragment
support to be able to start the SDK using aFragment
instance - Added integrator defined event hook to allow integrators to collect user analytics
- Added
DocumentCaptureStepBuilder
andFaceCaptureStepBuilder
to createFlowStep
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:
- Updated code snippets and descriptions related to API V3 in README
- Changed 'mobile sdk token' expression with 'mobile token' in README to prevent confusion
- 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:
- The
CaptureScreenStep
class deprecated. For more information, please visit our MIGRATION.md - The
FaceCaptureStep
class deprecated. For more information, please visit our MIGRATION.md
Added:
Face
property added intoCaptures
class- 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
Added:
DocumentType.GENERIC
type added. For more information, please visit our README.md
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
Added:
- Added SDK token support for US region
- Added ability to refresh SDK token when it expired. For more information, please visit our [README.md](https://github.com/onfido/onfido-android-sdk/blob/20.2.0/README.md#4.1 SDK Token)
- Internal: Basic device information started to logging
Removed
- Removed the
withUSDLAutocapture()
method from theOnfidoConfig.Builder
. The autocapture of the United States' driving license is now enabled by default - Removed applicant creation using the SDK, along with the
withApplicant(Applicant)
method of theOnfidoConfig.Builder
. The applicant should always from now on be created outside of the SDK and its id used to initialise the flowwithApplicant(String)
on theOnfidoConfig.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: Support new token format
- Added certificate pinning support. For more information, please visit our README.md
Added:
- Added the ability to skip the selfie intro screen by adding the
FaceCaptureVariantPhoto
that can be passed as an argument to aFaceCaptureStep
- Added the ability for integrators to specify a
Locale
for the flow to be displayed with, instead of inferring it from the device settings - Added the ability for integrators to enable an "exit when sent to background" mode in the SDK flow through the
exitWhenSentToBackground()
in theOnfidoConfig.Builder
. This mode enforces that the flow will automatically exit through theuserExited()
callback whenever the app is sent to background mid-flow - Added support for preselection of work permit documents, through the
DocumentType.WORK_PERMIT
enum value. This is a beta feature
Fixed:
- Fixed crash when initialising the capture screen and system returned a null camera to the SDK
- Fixed crash in the liveness confirmation screen, related with the usage of a vector drawable as the background of a button
- Fixed a crash when initialising the capture screen and we are not able to retrieve the camera parameters from the system
- Fixed crash happening when the activity
android:label
property is required to be non-blank
Fixed:
- Fixed crash when the SDK was wrongly doing operations with unknown request codes when transitioning from the capture screen to the flow screen
- Fixed crash when the SDK tries to access a view after the app was sent to background
- Fixed a crash when uploading the liveness video when the filename contains characters not supported by OkHttp
- Fixed a crash happening when face detection or tracking started on a device/emulator without Play Services
- Fixed a crash when reporting an error during the video recording back to the user while the error callback is
null
- 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.
Added:
- 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
Added:
- Added the ability to customise action buttons and icons colors
- 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:
- 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
Fixed
- Fixed bug which caused an unexpected behaviour when pressing back during a preselected document as first flow step
- 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
Added
- Added post capture barcode detection for United States driving license captures
- Added
strings.xml
as a public file, in order to enable custom localisation. More information can be found in our README.md - Added out-of-the-box Portuguese (
pt
) translation
[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
[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
- Added cross platform frameworks section in README.md
- Added support for Singaporean residence permits as identity documents
- Added
onError(OnfidoException exception, Applicant applicant)
callback on theOnfido
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
- Internal: Fixed crash on returning from the capture screen to the country list and to the document selection right after
- Internal: Fixed crash occasionally happening when closing the camera view (https://github.com/onfido/onfido-android-sdk/issues/12)
- Internal: Fixed crash when requesting focus repeatedly on capture screen
- Internal: Fixed crash occasionally happening when opening the camera view (https://github.com/onfido/onfido-android-sdk/issues/10)
- Internal: Fixed crash occasionally happening when starting the camera preview (https://github.com/onfido/onfido-android-sdk/issues/11)
- Internal: Fixed crash occasionally happening when the host app background process is killed while the SDK was running (https://github.com/onfido/onfido-android-sdk/issues/9)
[2.0.0]
Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md
Added
- Added
FaceCaptureStep(FaceCaptureVariant variant)
, which is a custom object to add a face capture step to the flow, with a variant of eitherFaceCaptureVariant.PHOTO
orFaceCaptureVariant.VIDEO
. Currently, the previousFlowStep.CAPTURE_FACE
is still available and is equivalent tonew 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
[1.0.0]
Note: This version contains breaking changes and is not backwards-compatible. Migration notes can be found in MIGRATION.md
Changed
Deprecated
MESSAGE_IDENTIFY_VERIFICATION
FlowStep
, since it is too specific for the purpose of the SDK, which should stay as generic as possibleChanged the default flow, accessible through
FlowStep.getDefaultFlow()
to include a welcome step, also accessible asFlowStep.WELCOME
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 captureRedesign of the message screen which results from a
MessageScreenStep
Internal:
FlowStep.WELCOME
andFlowStep.MESSAGE_FACE_VERIFICATION
now have a bullet points layout with new copyInternal: 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. Anull
check is now performed after the picture is taken, and an error message is shown in case it isnull
- 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
- Removed
FlowStep.MESSAGE
step. Developers should add aMessageScreenStep(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'stheme
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.
Added
- introduced allowMetrics, which allows the developer to choose whether SDK-only metrics may be taken.
- introduced CaptureScreenStep, which allows preselection of the document type on the flow configuration, hiding the document type selection view during the flow.
createIntent
was undeprecated, this is helpful when initiating the sdk from fragments.
Fixed
- 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.
Added
- Internal: A confirmation step shows up before sending the photo for validation.
- Added both
withBaseUrl(String)
andwithToken(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.
Fixed
- 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.
Added
startActivityForResult(Activity, int requestCode, OnfidoConfig)
andhandleActivityResult(int requestCode, int resultCode, Intent, OnfidoResultListener)
have both been added to simplify the callback process.createIntent(OnfidoConfig, int requestCode)
has been added to replacecreateIntent(OnfidoConfig config)
Removed
- The check is no longer initiated by the sdk.
extractCheckResult(Intent)
has been removedOnfidoConfig#withAsyncCheck(boolean)
andOnfido#withSyncWaitTime(int)
have been removed since they are related to check initiationFlowStep.SYNC_LOADING
has been removed as one of the possible steps.
- The deprecated
withCustomFlow(FlowAction[])
has been removed
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.
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
Onfido Android SDK Migration Guide
The guides below are provided to ease the transition of existing applications using the Onfido SDK from one version to another that introduces breaking API changes.
If your migration involves upgrading across multiple SDK versions, be sure to read each individual guide in order to account for all relevant breaking changes.
Removed
The following string keys have been removed:
onfido_app_title_doc_select
(en, ar, bg, cs, da, de, el, en-rGB, es, es-rUS, et, fa, fi, fr, fr-rCA, hi, hr, hu, hy, in, it, iw, ja, ko, lt, lv, ms, nb, nl, nn, pl, pt, pt-rBR, ro, ru, sk, sl, sr, sv, th, tr, uk, vi, zh-rCN, zh-rTW)##19.2.2
->19.3.0
Added
The following string keys have been added:
onfido_country_select_search_results_none_accessibility
onfido_country_select_search_results_one_accessibility
onfido_country_select_search_results_multiple_accessibility
onfido_doc_confirmation_alert_odp_photo_of_screen_title
onfido_doc_confirmation_alert_odp_screenshot_title
onfido_doc_confirmation_alert_odp_photocopy_title
onfido_doc_confirmation_alert_odp_scan_title
onfido_doc_confirmation_alert_odp_detail
onfido_doc_confirmation_button_secondary_change_document
onfido_doc_confirmation_button_secondary_submit_anyway
onfido_doc_capture_alert_manual_capture_video_title
19.0.0
-> 19.1.0
- Onfido SDK now supports the dark theme. By default, the user's active device theme will be
automatically applied to the Onfido SDK. However, you can opt out from dynamic theme switching at run time
and instead set a theme statically at the build time. In this case, the flow will always be in displayed
in the selected theme regardless of the user's device theme. Please refer to the dark theme section in
README.md
for further details on how to configure the SDK with a static UI theme. - Onfido's public colors defined in your
colors.xml
are now deprecated. Please refer to the "appearance and colors" section inREADME.md
for our new theme-based UI customization approach and the list of available attributes and UI customization options.
Breaking API changes
- Removed
Parcelable
implementation fromMediaCallback
and run it in the same process with the application. - Removed
Parcelable
implementation fromOnfidoAnalyticsEventListener
and run it in the same process with the application. - Removed
Parcelable
implementation fromTokenExpirationHandler
and run it in the same process with the application.
Breaking API changes
- Updated the properties of
MediaFile
(used for custom media callbacks) - it now contains 3 attributes: the file data, file type and file name - Dropped
Attr
suffix from font attribute names inOnfidoBaseActivityTheme
. - Removed the internal
onfidoFontFamily
attribute inOnfidoBaseActivityTheme
.
Added
- The
isOnfidoProcess
extension function has been integrated into the Application class. If you have implemented a custom Application class and are also using Firebase, please ensure to follow the instructions provided in this documentation for correct setup and integration.
Breaking changes
- After the release of version 17.0.0, Onfido Android SDK runs in a separate process. This means that when the callback is triggered, the body of that callback will run in Onfido SDK process rather than the main application process. Therefore, any actions performed in the callback, such as accessing memory or modifying UI, will be executed within the SDK process. It is important to keep this in mind when designing and implementing callbacks in order to ensure the proper functioning and performance of the SDK.
Added
The following string keys have been added:
onfido_enter_can_title
onfido_enter_can_subtitle
onfido_enter_can_button_primary
onfido_enter_can_disclaimer
onfido_enter_can_error_label
onfido_enter_can_substring_attempt_singular
onfido_enter_can_substring_attempt_plural
onfido_nfc_scan_error_title
onfido_nfc_scan_error_button_primary
onfido_nfc_scan_error_button_secondary
onfido_nfc_scan_error_list_item
onfido_nfc_scan_error_list_item_2
Removed
The following string keys have been removed:
onfido_nfc_fail_title
onfido_nfc_fail_button_primary
onfido_nfc_fail_button_secondary
onfido_nfc_fail_list_item_remove_cover
onfido_nfc_fail_list_item_keep_contact
onfido_nfc_intro_subtitle_card
onfido_nfc_intro_subtitle_passport
onfido_nfc_intro_button_primary_card
onfido_nfc_intro_button_primary_passport
Changed
The following string keys have been changed:
onfido_country_select_error_no_country_body_poa
->onfido_country_select_error_no_country_body
onfido_nfc_sheet_scanning_button_secondary
->onfido_nfc_sheet_button_secondary
onfido_nfc_intro_sheet_header_scanning
->onfido_nfc_intro_sheet_scanning_subtitle
onfido_nfc_sheet_success_instruction
->onfido_nfc_sheet_success_instruction_passport
onfido_doc_select_button_work_permit
->onfido_doc_select_button_permit_work
onfido_doc_select_section_input_placeholder_country_copy
->onfido_doc_select_section_input_placeholder_country
onfido_liveness_intro_loading_video
->onfido_video_intro_loader
onfido_doc_select_section_input_placeholder_country
->onfido_doc_select_section_input_country_not_found
onfido_doc_select_button_bill_detail_all
->onfido_doc_select_button_bill_detail
onfido_liveness_fetch_challenge_error_description
->onfido_video_capture_prompt_network_timeout_detail
onfido_liveness_intro_loading_video
->onfido_video_intro_loader
Removed
The following string keys have been removed:
onfido_permission_recovery_button_secondary_cam
onfido_permission_recovery_button_secondary_mic
onfido_permission_recovery_button_secondary_both
onfido_welcome_list_item_doc
onfido_permission_recovery_subtitle_video
onfido_permission_recovery_extra_instructions_cam
onfido_permission_recovery_extra_instructions_mic
onfido_permission_recovery_extra_instructions_both
onfido_permission_recovery_body_mic
onfido_permission_recovery_body_cam
onfido_permission_recovery_body_both
onfido_app_title_user_consent
onfido_country_select_error_no_country_body
onfido_welcome_list_item_video
onfido_doc_confirmation_body_visa
onfido_welcome_list_item_selfie
onfido_welcome_list_header_photo
onfido_welcome_list_header_record
onfido_welcome_list_header_doc_video
onfido_app_title_doc_video_confirmation
onfido_doc_capture_header_license_front_auto
onfido_doc_capture_header_visa_back
onfido_doc_capture_header_passport_auto
onfido_doc_capture_header_license_back_auto
onfido_doc_capture_frame_accessibility_pp_cover_manual
onfido_doc_capture_frame_accessibility_pp_manual
onfido_welcome_list_item_face_generic
onfido_doc_capture_alert_no_face_title
onfido_doc_capture_alert_no_face_detail
onfido_doc_capture_header_live_guidance_distance_ok
onfido_doc_capture_header_live_guidance_distance_ok_accessibility
onfido_nfc_intro_sheet_scanning_subtitle
onfido_avc_connection_error_button_primary_reload
onfido_doc_select_button_bill_detail
onfido_poa_country_not_found
onfido_doc_select_extra_no_mobile
onfido_label_doc_type_driving_license_short
onfido_label_doc_type_residence_permit_short
onfido_face_tracking_timeout_button_retry
onfido_allow
onfido_permission_subtitle_video
onfido_permission_body_video
onfido_accessibility_liveness_confirmation_view
onfido_nfc_sheet_ready_button_secondary
onfido_nfc_intro_sheet_header_scan_retry
onfido_nfc_sheet_scanning_instruction_retry
onfido_nfc_intro_sheet_header_fail_passport
onfido_nfc_intro_sheet_header_fail_card
onfido_nfc_intro_sheet_header_ready_card
onfido_nfc_intro_sheet_header_ready_passport
onfido_poa_document_submission_empty
onfido_flow_user_exit_message_user_cancelled
Added
The following string keys have been added:
onfido_avc_intro_title_accessibility
onfido_avc_intro_video_accessibility
onfido_avc_face_capture_frame_accessibility
onfido_avc_confirmation_left_side_complete_accessibility
onfido_avc_confirmation_right_side_complete_accessibility
onfido_avc_face_capture_title_accessibility
onfido_avc_face_capture_recording_started_accessibility
onfido_avc_face_alignment_feedback_face_aligned_accessibility
onfido_avc_face_alignment_feedback_move_closer_accessibility
onfido_avc_face_alignment_feedback_move_back_accessibility
onfido_avc_face_alignment_title_accessibility
onfido_avc_face_alignment_feedback_no_face_detected_accessibility
Breaking API changes
- Removed the option to implement the user consent screen directly in your configuration during SDK initialization. It is now controlled by the Onfido backend. Please see our Onfido privacy notices and consent migration guide for further information.
Added
The following string keys have been added:
onfido_nfc_intro_sheet_ready_subtitle_passport
onfido_nfc_intro_sheet_scanning_subtitle
onfido_nfc_intro_sheet_ready_subtitle_card
onfido_nfc_intro_sheet_fail_instructions_card
onfido_nfc_intro_sheet_fail_subtitle_card
onfido_nfc_intro_sheet_fail_subtitle_passport
onfido_nfc_intro_sheet_fail_instructions_passport
Added
The following string keys have been added:
onfido_nfc_select_title_passport
onfido_nfc_select_subtitle_passport
onfido_nfc_select_body_passport
onfido_nfc_select_button_primary_passport
onfido_nfc_select_button_secondary_passport
onfido_nfc_intro_title_passport
onfido_nfc_intro_subtitle_passport
onfido_nfc_intro_button_primary_passport
onfido_nfc_intro_sheet_header_ready_passport
onfido_nfc_fail_title_passport
onfido_nfc_fail_list_item_remove_cover_passport
onfido_nfc_fail_list_item_keep_contact_passport
onfido_nfc_fail_button_primary_passport
onfido_nfc_fail_button_secondary_passport
onfido_nfc_select_title_card
onfido_nfc_select_subtitle_card
onfido_nfc_select_body_card
onfido_nfc_select_button_primary_card
onfido_nfc_select_button_secondary_card
onfido_nfc_intro_title_card
onfido_nfc_intro_subtitle_card
onfido_nfc_intro_sheet_header_ready_card
onfido_nfc_fail_title_card
onfido_nfc_fail_list_item_remove_cover_card
onfido_nfc_fail_list_item_keep_contact_card
onfido_nfc_sheet_success_instruction_card
onfido_nfc_intro_sheet_header_fail_passport
onfido_nfc_intro_button_primary_card
onfido_nfc_intro_sheet_header_fail_card
onfido_nfc_fail_button_primary_card
onfido_nfc_fail_button_secondary_card
Removed
The following string keys have been removed:
onfido_nfc_select_title
onfido_nfc_select_subtitle
onfido_nfc_select_button_primary
onfido_nfc_select_button_secondary
onfido_nfc_select_body
onfido_nfc_intro_title
onfido_nfc_intro_sheet_header_ready
onfido_nfc_sheet_ready_subtitle
onfido_nfc_intro_subtitle
onfido_nfc_sheet_success_intruction
onfido_nfc_intro_button_primary
onfido_nfc_fail_title
onfido_nfc_fail_list_item_remove_covers
onfido_nfc_fail_list_item_keep_contact
onfido_nfc_fail_button_primary
onfido_nfc_fail_button_secondary
Added
The following string keys have been added:
onfido_doc_capture_header_live_guidance_intro_doc_front_accessibility
onfido_doc_capture_header_live_guidance_no_doc
onfido_doc_capture_header_live_guidance_no_doc_accessibility
onfido_doc_capture_header_live_guidance_distance_close
onfido_doc_capture_header_live_guidance_distance_close_accessibility
onfido_doc_capture_header_live_guidance_distance_far
onfido_doc_capture_header_live_guidance_distance_far_accessibility
onfido_doc_capture_header_live_guidance_distance_ok
onfido_doc_capture_header_live_guidance_distance_ok_accessibility
onfido_doc_capture_header_live_guidance_doc_too_left
onfido_doc_capture_header_live_guidance_doc_too_left_accessibility
onfido_doc_capture_header_live_guidance_doc_too_right
onfido_doc_capture_header_live_guidance_doc_too_right_accessibility
onfido_doc_capture_header_live_guidance_doc_too_high
onfido_doc_capture_header_live_guidance_doc_too_high_accessibility
onfido_doc_capture_header_live_guidance_doc_slightly_high
onfido_doc_capture_header_live_guidance_doc_slightly_high_accessibility
onfido_doc_capture_header_live_guidance_doc_too_low
onfido_doc_capture_header_live_guidance_doc_too_low_accessibility
onfido_doc_capture_header_live_guidance_doc_slightly_low
onfido_doc_capture_header_live_guidance_doc_slightly_low_accessibility
onfido_doc_capture_header_live_guidance_doc_position_ok
onfido_doc_capture_header_live_guidance_doc_position_ok_accessibility
onfido_doc_capture_header_live_guidance_intro_doc_front
onfido_doc_capture_header_live_guidance_intro_doc_back
onfido_doc_capture_header_live_guidance_intro_doc_back_accessibility
onfido_doc_capture_header_live_guidance_intro_pp_photo
onfido_doc_capture_header_live_guidance_intro_pp_photo_accessibility
Added
The following string keys have been added:
onfido_welcome_list_header
onfido_welcome_list_item_doc_photo
onfido_welcome_list_item_doc_video
onfido_welcome_list_item_doc_generic
onfido_welcome_list_item_face_photo
onfido_welcome_list_item_face_video
onfido_welcome_list_item_face_generic
onfido_nfc_select_title_passport
onfido_nfc_select_subtitle_passport
onfido_nfc_select_body_passport
onfido_nfc_select_button_primary_passport
onfido_nfc_select_button_secondary_passport
onfido_nfc_intro_title_passport
onfido_nfc_intro_subtitle_passport
onfido_nfc_intro_button_primary_passport
onfido_nfc_intro_sheet_header_ready_passport
onfido_nfc_sheet_success_instruction
onfido_nfc_fail_title_passport
onfido_nfc_fail_list_item_remove_cover_passport
onfido_nfc_fail_list_item_keep_contact_passport
onfido_nfc_fail_button_primary_passport
onfido_nfc_fail_button_secondary_passport
onfido_nfc_select_title_card
onfido_nfc_select_subtitle_card
onfido_nfc_select_body_card
onfido_nfc_select_button_primary_card
onfido_nfc_select_button_secondary_card
onfido_nfc_intro_title_card
onfido_nfc_intro_subtitle_card
onfido_nfc_intro_sheet_header_ready_card
onfido_nfc_fail_title_card
onfido_nfc_fail_list_item_remove_cover_card
onfido_nfc_fail_list_item_keep_contact_card
onfido_nfc_sheet_success_instruction_card
onfido_nfc_intro_sheet_header_fail_passport
onfido_nfc_intro_button_primary_card
onfido_nfc_intro_sheet_header_fail_card
onfido_nfc_fail_button_primary_card
onfido_nfc_fail_button_secondary_card
Changed
The following string keys have been changed:
onfido_doc_capture_header_folded_doc_front
onfido_doc_capture_header_folded_doc_back
onfido_doc_capture_header_license_front
onfido_doc_capture_header_license_back
onfido_doc_capture_header_permit_front
onfido_doc_capture_header_permit_back
onfido_doc_capture_header_id_front
onfido_doc_capture_header_id_back
onfido_doc_capture_header_permit_work_front
onfido_doc_capture_header_generic_front
onfido_doc_capture_header_permit_work_back
onfido_doc_capture_header_generic_back
onfido_doc_capture_header_visa_front
onfido_doc_capture_header_visa_back
onfido_doc_capture_header_passport
onfido_doc_capture_header_license_front_auto
onfido_doc_capture_header_license_back_auto
onfido_doc_capture_header_passport_auto
onfido_doc_capture_frame_accessibility_pp_auto
onfido_doc_capture_frame_accessibility_dl_front_auto
onfido_doc_capture_frame_accessibility_dl_back_auto
onfido_doc_capture_frame_accessibility_pp_manual
onfido_doc_capture_frame_accessibility_dl_front_manual
onfido_doc_capture_frame_accessibility_dl_back_manual
onfido_doc_capture_frame_accessibility_ic_front_manual
onfido_doc_capture_frame_accessibility_ic_back_manual
onfido_doc_capture_frame_accessibility_rp_front_manual
onfido_doc_capture_frame_accessibility_rp_back_manual
onfido_doc_capture_frame_accessibility_dl_fr_front_manual
onfido_doc_capture_frame_accessibility_dl_fr_back_manual
onfido_doc_capture_frame_accessibility_ic_it_front_manual
onfido_doc_capture_frame_accessibility_ic_it_back_manual
onfido_doc_capture_frame_accessibility_ic_za_front_manual
onfido_doc_capture_frame_accessibility_ic_za_back_manual
onfido_doc_capture_frame_accessibility_pp_cover_manual
Removed
The following string keys have been removed:
onfido_nfc_select_title
onfido_nfc_select_subtitle
onfido_nfc_select_button_primary
onfido_nfc_select_button_secondary
onfido_nfc_select_body
onfido_nfc_intro_title
onfido_nfc_intro_sheet_header_ready
onfido_nfc_intro_subtitle
onfido_nfc_sheet_success_intruction
onfido_nfc_intro_button_primary
onfido_nfc_fail_title
onfido_nfc_fail_list_item_remove_covers
onfido_nfc_fail_list_item_keep_contact
onfido_nfc_fail_button_primary
onfido_nfc_fail_button_secondary
Added
The following string keys have been added:
onfido_doc_capture_frame_accessibility_pp_auto
onfido_doc_capture_frame_accessibility_dl_front_auto
onfido_doc_capture_frame_accessibility_dl_back_auto
onfido_doc_capture_frame_success_accessibility
onfido_doc_capture_frame_accessibility_rp_front_manual
onfido_doc_capture_frame_accessibility_rp_back_manual
onfido_doc_capture_frame_accessibility_ic_front_manual
onfido_doc_capture_frame_accessibility_ic_back_manual
onfido_doc_capture_frame_accessibility_dl_fr_front_manual
onfido_doc_capture_frame_accessibility_dl_fr_back_manual
onfido_doc_capture_frame_accessibility_ic_it_front_manual
onfido_doc_capture_frame_accessibility_ic_it_back_manual
onfido_doc_capture_frame_accessibility_ic_za_front_manual
onfido_doc_capture_frame_accessibility_ic_za_back_manual
onfido_video_capture_frame_accessibility
Added
The following string keys have been added:
onfido_permission_recovery_button_primary
onfido_permission_recovery_list_item_how_to_cam
onfido_permission_recovery_list_item_action_cam
onfido_permission_recovery_list_item_how_to_mic
onfido_permission_recovery_list_item_action_mic
onfido_permission_recovery_list_item_how_to_both
onfido_permission_recovery_list_item_action_both
onfido_video_capture_header_challenge_turn_forward
onfido_generic_uploading
onfido_doc_confirmation_alert_crop_detail
onfido_doc_confirmation_alert_crop_title
onfido_doc_upload_progress_label
onfido_video_intro_list_item_time_limit_copy
onfido_app_title_selfie_confirmation
onfido_app_title_video_confirmation
onfido_doc_capture_header_passport_auto
onfido_doc_capture_detail_passport
onfido_doc_capture_header_license_front_auto
onfido_video_capture_body
onfido_doc_capture_header_license_back_auto
onfido_welcome_list_header_photo
onfido_welcome_list_header_record
onfido_app_title_doc_confirmation
onfido_app_title_permission
onfido_app_title_selfie_intro
onfido_app_title_video_intro
onfido_welcome_list_header_doc_video
onfido_app_title_doc_video_confirmation
onfido_video_capture_turn_success_accessibility
Removed
The following string keys have been removed:
onfido_permission_extra_instructions_cam
onfido_permission_extra_instructions_mic
onfido_permission_extra_instructions_both
onfido_permission_recovery_button_primary_cam
onfido_permission_recovery_button_primary_mic
onfido_permission_recovery_button_primary_both
onfido_app_title_doc_capture_visa
onfido_app_title_doc_capture_permit_work
onfido_app_title_doc_capture_generic
onfido_app_title_doc_capture_passport
onfido_app_title_doc_capture_permit
onfido_app_title_doc_capture_id
onfido_app_title_doc_capture_license
onfido_doc_capture_detail_passport_auto
onfido_doc_confirmation_body_passport
onfido_doc_confirmation_body_permit
onfido_doc_confirmation_body_license
onfido_doc_confirmation_body_id
onfido_doc_confirmation_body_permit_work
onfido_selfie_confirmation_button_primary_long
onfido_selfie_confirmation_button_primary_short
onfido_selfie_confirmation_button_secondary_long
onfido_selfie_confirmation_button_secondary_short
onfido_video_confirmation_title
onfido_welcome_list_item_doc_video
onfido_doc_confirmation_alert_no_barcode_title
onfido_welcome_button_primary_selfie
onfido_welcome_button_primary_video
onfido_doc_capture_detail_license_front_auto
Changed
The following string keys have been changed:
onfido_app_title_welcome
onfido_permission_subtitle_cam
onfido_permission_body_cam
onfido_permission_recovery_title_cam
onfido_permission_recovery_subtitle_cam
onfido_permission_subtitle_mic
onfido_permission_body_mic
onfido_permission_recovery_title_mic
onfido_permission_recovery_subtitle_mic
onfido_permission_subtitle_both
onfido_permission_body_both
onfido_permission_button_primary_both
onfido_permission_recovery_title_both
onfido_permission_recovery_subtitle_both
onfido_doc_confirmation_button_primary_passport
onfido_doc_confirmation_button_primary_permit
onfido_doc_confirmation_button_primary_license
onfido_doc_confirmation_button_primary_id
onfido_doc_confirmation_button_primary_visa
onfido_doc_confirmation_button_primary_generic
onfido_doc_confirmation_button_primary_barcode
onfido_doc_confirmation_button_primary_permit_work
onfido_doc_confirmation_button_secondary_passport
onfido_doc_confirmation_button_secondary_id
onfido_doc_confirmation_button_secondary_license
onfido_doc_confirmation_button_secondary_permit
onfido_doc_confirmation_button_secondary_permit_work
onfido_doc_confirmation_button_secondary_visa
onfido_doc_confirmation_button_secondary_generic
onfido_video_capture_header_challenge_turn_left
onfido_video_capture_header_challenge_turn_right
onfido_video_intro_button_primary
onfido_selfie_intro_button_primary
onfido_doc_select_button_license
onfido_doc_select_button_permit
onfido_welcome_subtitle
onfido_welcome_list_item_doc
onfido_welcome_list_item_selfie
onfido_welcome_list_item_video
onfido_video_intro_title
onfido_doc_select_title
onfido_doc_select_subtitle
onfido_country_select_bottom_sheet_details
onfido_country_select_bottom_sheet_link_doc_select
onfido_selfie_intro_subtitle
onfido_selfie_intro_list_item_face_forward
onfido_selfie_intro_list_item_no_glasses
onfido_selfie_capture_body
onfido_selfie_confirmation_body
onfido_doc_capture_detail_visa_front
onfido_doc_capture_detail_visa_back
onfido_selfie_confirmation_alert_no_face_title
onfido_selfie_confirmation_alert_no_face_detail
onfido_doc_confirmation_alert_no_doc_detail
onfido_doc_confirmation_body_visa
onfido_doc_confirmation_body_generic
onfido_doc_capture_detail_permit_front
onfido_doc_capture_detail_permit_back
onfido_doc_capture_detail_license_front
onfido_doc_capture_detail_license_back
onfido_doc_capture_detail_id_front
onfido_doc_capture_detail_id_back
onfido_doc_capture_detail_permit_work_front
onfido_doc_capture_detail_generic_front
onfido_doc_capture_detail_permit_work_back
onfido_doc_capture_detail_generic_back
onfido_doc_capture_alert_glare_title
onfido_video_intro_subtitle
onfido_video_intro_list_item_move_speak
onfido_video_intro_list_item_time_limit
onfido_video_capture_prompt_detail_timeout
onfido_video_confirmation_button_audio_unmute
onfido_country_select_error_no_country_title
onfido_country_select_error_no_country_body
onfido_doc_capture_alert_manual_capture_detail
onfido_doc_confirmation_alert_blur_title
onfido_doc_confirmation_alert_blur_detail
onfido_doc_capture_alert_no_barcode_title
onfido_doc_capture_header_passport
onfido_permission_body_mic
onfido_permission_body_both
onfido_doc_confirmation_button_primary_passport
onfido_doc_confirmation_button_primary_id
onfido_doc_confirmation_button_primary_visa
onfido_doc_confirmation_button_primary_generic
onfido_doc_confirmation_button_primary_barcode
onfido_doc_confirmation_button_primary_folded_doc
onfido_selfie_confirmation_button_secondary
onfido_selfie_confirmation_button_primary
onfido_app_title_doc_select
onfido_welcome_button_primary_doc
onfido_video_intro_video_accessibility
onfido_video_capture_frame_success_accessibility
onfido_video_confirmation_video_accessibility
onfido_video_capture_header_challenge_digit_instructions_accessibility
onfido_video_capture_header_challenge_turn_instructions_accessibility
onfido_video_capture_header_extra_instructions_accessibility
onfido_video_capture_header_challenge_turn_left_accessibility
onfido_video_capture_header_challenge_turn_right_accessibility
onfido_video_confirmation_button_play_and_pause_accessibility
onfido_doc_capture_button_accessibility
Added
The following string keys have been added:
onfido_user_consent_button_primary
onfido_user_consent_button_secondary
onfido_user_consent_prompt_no_consent_title
onfido_user_consent_prompt_no_consent_detail
onfido_user_consent_prompt_button_primary
onfido_user_consent_prompt_button_secondary
onfido_app_title_user_consent
Breaking changes
- Updated to OkHttp4. In order to prevent runtime issues due to library conflicts, the host app must match the major version of the OkHttp.
Changed
- ⚠️ 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
migrate-keys.rb --files-path <app/src/main/res/> --platform android --key-mapping-file key_migration_7_3_0_mapping.json
Breaking changes
- Migrated to AndroidX. If your app hasn't completed AndroidX migration yet, please see AndroidX Migration.
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 theCaptures
object which is provided byhandleActivityResult
ifresidence permit
orgeneric
is selected
Added:
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
Breaking API changes
- Removed
OnfidoCertificatePinningSettings
class which hasONFIDO_API
parameter to provide root certificate's hash value. For more information, please visit our README.md
Added
The following string keys have been added:
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
Deprecation
- The
withApplicant(String)
and thewithToken(String)
methods are deprecated from theOnfidoConfig.Builder
, we now recommend that create a SDK Token on your backend which containsapplicantId
and usewithSDKToken(String)
method to initialise the OnfidoConfig
Before
The initialisation of the SDK by passing the applicant ID and the (static) mobile token:
val OnfidoConfig config = OnfidoConfig.builder() .withToken("YOUR_MOBILE_TOKEN") .withApplicant("YOUR_APPLICANT_ID") .build();
or if you were using the deprecated withApplicant(Applicant)
method:
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:
@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:
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:
@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 } }); }
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
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 theuserCompleted(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 theonError(OnfidoException exception, @Nullable Applicant applicant)
callback to be a nullable value, meaning that depending on the error originating the callback, the applicant details might benull
. 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 theOnfido
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:
gradleCopycompile ('com.google.android.gms:play-services-base:x.y.z') { exclude group: 'com.android.support' // to avoid conflicts with your current support library }
Breaking changes
- Removed the
allowMetrics(boolean)
method from theOnfidoConfig.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 customMessageScreenStep