Skip to main content

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:

Check 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:

StatusDescription
OKAYLicense is valid and accepted
TRIALNo license set yet. The SDK is in trial mode
OKAY_EXPIRING_SOONLicense is valid but will expire soon. Update before expiration
FAILURE_NOT_SETNo license set. Trial mode is over (on platforms that support it)
FAILURE_CORRUPTEDThe set license was unreadable or has an invalid format
FAILURE_WRONG_OSThe set license does not cover the current operating system
FAILURE_APP_ID_MISMATCHThe set license does not cover the current app's bundle identifier
FAILURE_EXPIREDThe set license has expired
FAILURE_VERSIONThe set license does not cover the current SDK version
FAILURE_INACTIVEThe set license is not yet active

Handling License Status

You can check the license status and handle different scenarios:

Handle license status
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}")
}
warning

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 license