Handling the Kotlin Multiplatform Document Scanner SDK license
License key
To run the Scanbot SDK within your production app, you must purchase and use a valid Scanbot SDK license.
Each license key is valid only for a given app bundle identifier. You will be unable to use any of the SDK features if the license key is corrupted, expired, or invalid in any other way.
Trial license
The Scanbot SDK will run without a license for one minute per session. To get a free 7-day trial license, please submit the trial license form.
Please note that you may only use a trial license in development and staging environments. You are not allowed to publish your app to the App Store, Play Store, or any third-party app store without a production license.
Purchasing a production license
To receive pricing information or purchase a production license for the Scanbot SDK, please request a quote.
License checks in production apps
The following is an example of how to check the license status:
val licenseInfo = ScanbotSDK.getLicenseInfo()
licenseInfo.onSuccess { info ->
println("License status: ${info.status}")
println("Is valid: ${info.isValid}")
println("Expiration date: ${info.expirationDateString}")
}.onFailure { exception ->
println("Failed to get license info: ${exception.message}")
}
License information
The getLicenseInfo() method returns a Result<LicenseInfo> object that contains detailed information about the current license status.
License status values
The LicenseStatus enum represents the current state of the SDK license:
| Status | Description |
|---|---|
| OKAY | License is valid and accepted |
| TRIAL | No license set yet. The SDK is in trial mode |
| OKAY_EXPIRING_SOON | License is valid but will expire soon. Update before expiration |
| FAILURE_NOT_SET | No license set. Trial mode is over (on platforms that support it) |
| FAILURE_CORRUPTED | The set license was unreadable or has an invalid format |
| FAILURE_WRONG_OS | The set license does not cover the current operating system |
| FAILURE_APP_ID_MISMATCH | The set license does not cover the current app's bundle identifier |
| FAILURE_EXPIRED | The set license has expired |
| FAILURE_VERSION | The set license does not cover the current SDK version |
| FAILURE_INACTIVE | The set license is not yet active |
Handling License Status
You can check the license status and handle different scenarios:
ScanbotSDK.getLicenseInfo().onSuccess { licenseInfo ->
when (licenseInfo.status) {
LicenseStatus.OKAY -> {
// License is valid - proceed with SDK operations
println("License is valid until: ${licenseInfo.expirationDateString}")
}
LicenseStatus.OKAY_EXPIRING_SOON -> {
// License will expire soon - notify user to renew
println("Warning: License expires soon on ${licenseInfo.expirationDateString}")
}
LicenseStatus.TRIAL -> {
// SDK is in trial mode
println("SDK is running in trial mode")
}
LicenseStatus.FAILURE_EXPIRED -> {
// License has expired
println("License expired on ${licenseInfo.expirationDateString}")
}
LicenseStatus.FAILURE_APP_ID_MISMATCH -> {
// License doesn't match the app bundle ID
println("License does not match app bundle identifier")
}
LicenseStatus.FAILURE_NOT_SET -> {
// No license set and trial has ended
println("No license set. Trial period has ended")
}
else -> {
// Handle other failure cases
println("License error: ${licenseInfo.licenseStatusMessage}")
if (licenseInfo.errorMessage.isNotEmpty()) {
println("Error details: ${licenseInfo.errorMessage}")
}
}
}
}.onFailure { exception ->
// Handle error when getting license info
println("Failed to retrieve license info: ${exception.message}")
}
Always handle license status appropriately in production apps. Do not ignore license validation failures, as this may lead to unexpected SDK behavior or functionality limitations.
Updating the license in production apps
The expiration date and the feature list of a license are contained in the license key string as encrypted data. This means that renewing or extending a license will cause a new license key string to be generated.
To renew an expired license or extend a valid license with additional Scanbot SDK features, you will have to deploy a new version of the app with an updated license key.
Alternatively, you can dispatch the new key via Firebase Remote Config or load it from your web API, but we do not provide an out-of-the box solution for this.
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
