Getting Started
Installation and Initialization
Requirements
Android 5.0+ (API level 21+)
A
smile_config.json
file from your portal Security Settings page
SDK Versions
We’re excited to share that our mobile SDKs have been upgraded from v10 to v11, bringing you enhanced functionality while maintaining full backward compatibility. These non-breaking updates ensure a smooth transition by simply updating to v11 to access the latest features without altering your existing integration.
Note: For native Android, please use version 11.0.2 or later to guarantee optimal performance.
For complete details, including bug fixes and new capabilities, please refer to our release notes.
Dependency
The latest release is available on Maven Central and on GitHub.
Snapshot builds are also available.
Add the dependency to your module-level Gradle Build file
implementation("com.smileidentity:android-sdk:<latest-version>")
Smile Config
Place the smile_config.json
file under your application's assets, located at src/main/assets
(This should be at the same level as your java
and res
directories)
⚠️ Note: The smile_config.json
file is unique to the environment (sandbox/production) and api key for which it was created. This means you will need one file for each environment (sandbox/production) of your application.
Initialization
Initialize the Smile ID SDK in your Application
class onCreate
⚠️ Note: The SmileID.initialize()
method now returns a deferred result. You can use you can use the isSuccess
and isFailure
properties of Result
. An exception is thrown if MLKit initialization fails. You will need to handle this exception in your application.
See the guide here to use the bundled version which fixes the exception.
package com.example.app
import android.app.Application
import com.smileidentity.SmileID
class ExampleApplication : Application() {
override fun onCreate() {
super.onCreate()
SmileID.initialize(this)
}
}
Callback URL
To set the callback URL used for jobs (to deliver results to your own server), use the setCallbackUrl method
SmileID.setCallbackUrl(URL("https://smileidentity.com"))
Environments (Sandbox/Production)
To switch between Sandbox and Production you should initialize using:
SmileID.initialize(context = this, useSandbox = true)
Usage
Javadoc
The latest Javadocs can be found here
All Products are implemented using Jetpack Compose and therefore exposed as Composable functions. This is the encouraged usage pattern.
If your application employs the traditional View-based approach, then we also expose androidx.fragment.app.Fragment
based wrappers around the Composables. You should use getSupportFragmentManager().setFragmentResultListener(...)
to listen for results. Examples are provided for each product.
Networking
The product screens will handle performing all network requests for you. However, it is also possible to make REST API calls directly via SmileID.api
. Please refer to the Javadoc for further details.
Checking Job Status
Use SmileID.api.pollSmartSelfieJobStatus
, SmileID.api.pollDocVJobStatus
, or SmileID.api.pollBiometricKycJobStatus
to poll a given Job's status until it is complete.
The delay and number of attempts is configurable.
Alternatively, you may use SmileID.api.getSmartSelfieJobStatus
, SmileID.api.getDocVJobStatus
, or SmileID.api.getBiometricKycJobStatus
to perform a one-off job status check.
Crash Reporting (Android only)
Crash reporting is enabled by default. Only crashes caused by Smile Identity will be reported. This will not interfere with any other crash reporting you may be doing.
It can optionally be disabled by calling SmileIDCrashReporting.disable()
at runtime or by passing false
at initialization (Not Recommended)
Please refer to the Javadoc on SmileIDCrashReporting
for further details.
Submitting to the App Store (iOS Only)
The Smile ID SDK for iOS uses the TrueDepth API. As a result, you must declare this API usage to Apple when submitting your iOS app for review to the App Store. Here is the relevant information you may be asked to provide:
What information is your app collecting
We use ARKit to capture face 3D spatial orientation and facial expressions.
For what purposes are you collecting this information
We use this data to ensure the selfie being taken is of a live user for authentication and fraud reduction purposes.
Will the data be shared with any third parties
The ARKit information is processed entirely locally and the spatial orientation/facial expression data is not submitted to any third (or first) parties
Resources
All resource identifiers defined by the SDK are prefixed by si_
so as to prevent naming clashes with your application resources. You may override any resource value -- for further information, see Customization
File Handling (Android only)
Captured files are saved to the result of calling context.getDir("SmileID", MODE_PRIVATE)
, which is usually: /data/user/0/<package name>/app_SmileID
Troubleshooting
Camera / webView related issues
Please see the troubleshooting guide here for situations where the camera is loading in full screen.
Last updated
Was this helpful?