Skip to main content

SDK Initialization | Windows 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.

Trial License

Unlike our other SDKs, the Windows SDK does not offer a trial mode of one minute. A trial license key is required for evaluation or testing. To get a free "no-strings-attached" 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 Microsoft Store or any 3rd party app store with a trial license.

Package Name

The Scanbot SDK license key is bound to the Package Name of a UWP app which can be found in Packaging settings:

Open the Package.appxmanifest file of your UWP project and see the Package name field in the Packaging tab.

Alternatively, go to the Properties of your project ➜ ApplicationPackage Manifest... ➜ open the Packaging tab ➜ Package name.

Purchase a Production License

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

Initialize

Free Developer Support

We provide free "no-strings-attached" developer support for the implementation & testing of the Scanbot SDK. If you encounter technical issues with integrating the Scanbot SDK or need advice on choosing the appropriate framework or features, please visit our Support Page.

The Scanbot SDK must be initialized before usage. Initialization requires a license key and returns a license info object that can be used to check the status and validity of the license. Add the following code snippets to the Application class of your UWP project (e.g. App.xaml.cs):

sealed partial class App : Application
{
const string LICENSE_KEY = "..."; // insert your (trial) license key here
...
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
...
var license = Scanbot.BarcodeSDK.Initialize(LICENSE_KEY);
}
...
}

To get the license details after the SDK initialization and elsewhere in the app, you can use the following API method:

Scanbot.Model.License license = Scanbot.LicenseManager.Details;

License Checks in Production Apps

caution

If your Scanbot SDK license key has expired, calls to the SDK API will return empty results. To prevent this you should always check for license expiration during the runtime via Scanbot.LicenseManager.Details.IsValid. If this boolean property returns false, you should disable any usage of the Scanbot Barcode Scanner SDK (functions, UI components, etc.). You can get more details about the license via Scanbot.LicenseManager.Details.Status and Scanbot.LicenseManager.Details.Description.

We highly recommend implementing a suitable handling of this case in your app!

Example code for checking the license status:

var license = Scanbot.LicenseManager.Details;
if (license.IsValid)
{
// OK, your license is valid.
// Making your call into ScanbotSDK API is now safe.
// E.g. start the barcode scanner UI.
}
else
{
// The license is invalid! Don't call any Scanbot SDK features!
// Implement suitable error handling.
// Also, see the values of "license.Status" and "license.Description".
}

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get your free Trial License

What do you think of this documentation?