Skip to main content

License Handling | Capacitor Barcode Scanner

License Key

In order 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.

Getting a Trial license

The Scanbot SDK will run without a license for one minute per session! To get a free, "no-strings-attached" 7-day trial license, please submit the Trial License Form on our website.

Please kindly note that a trial license can only be used in a development and staging environment. You are not allowed to publish your app to the App Store, Play Store, or any 3rd party Android App Store with a trial license.

Purchase a Production License

To get pricing information and purchase a production license for the Scanbot SDK please request a quote.

Check License Status

If your Scanbot Barcode Scanner SDK license has expired, any call of the Scanbot Barcode Scanner SDK API will be canceled or rejected. To prevent this, before every API call, you should validate the license by calling the method ScanbotBarcodeSDK.getLicenseInfo(). If the result returns result.data?.isLicenseValid !== true, you should disable any usage of the Scanbot Barcode Scanner SDK functions or UI components in your app. We highly recommend implementing a suitable handling of this case in your app!

try {
const result = await ScanbotBarcodeSDK.getLicenseInfo();

if (result.data?.isLicenseValid === true) {
// We have a valid (trial) license and can call other Scanbot Barcode Scanner SDK methods.
// E.g. launch the Barcode Scanner
return true;
} else {
// The license is not valid. We will return false and show the status
this.utils.showWarningAlert(result.data?.licenseStatusMessage ?? 'Invalid License');
}
} catch (error: any) {
this.utils.showErrorAlert(error);
}

return false;

LicenseInfoResult

export interface LicenseInfoResult {
/** True if the license is valid, false otherwise */
isLicenseValid: boolean;
/** The license status */
licenseStatus: LicenseStatus;
/** Detailed license status message for development and debug purposes */
licenseStatusMessage?: string;
/** The license expiration date in milliseconds */
licenseExpirationDate?: number;
}

LicenseStatus Type

export type LicenseStatus =
/** License is valid and accepted. */
| 'Okay'
/** No license set yet. The SDK is in trial mode. */
| 'Trial'
/** No license set yet. The SDKs trial mode is over. */
| 'Expired'
/** No license active. The set license does not cover the current operating system. */
| 'WrongOS'
/** No license active. The set license was unreadable or has an invalid format. */
| 'Corrupted'
/** No license active. The set licenses does not cover the current apps bundle identifier. */
| 'AppIDMismatch'
/** No license set yet. The SDKs trial mode is over. */
| 'NotSet';

Updating the license in production apps

To renew an expired license or extend a valid license with new Scanbot Barcode SDK features, you will have to update your app in the App Store. The expiration date and the feature list of a license are contained in an encrypted data part of the license key string. This means a renewal or extension of a license will cause a new license key string to be generated.

Want to scan longer than one minute?

Generate your free "no-strings-attached" Trial License and properly test the Scanbot SDK.

Get your free Trial License

What do you think of this documentation?