Resource Base
Table of contents

LicenseManager

The LicenseManager class provides a set of APIs to manage the licensing for the Dynamsoft Capture Vision architecture.

API Description
static getDeviceUUID Returns the unique identifier of the device.
static initLicense Initializes the license for the application using a license key.
static setDeviceFriendlyName Assigns a distinctive name to the device, correlating it with its UUID.

getDeviceUUID

Returns the unique identifier of the device.

static getDeviceUUID(): Promise<string>;

Return Value

A promise which, upon resolution, yields a string corresponding to the device’s UUID.

initLicense

Initializes the license for the application using a license key. This function is overloaded, providing two different usages based on the provided parameters.

static initLicense(license: string, immediately?: boolean): void | Promise<void>;

Parameters

license: The license key to be used for initialization.

immediately: A boolean flag that determines if the function should immediately execute the license initialization or not.

Return Value

void

  • When immediately is undefined or false, this signature of initLicense passes the license key to the application for initialization at a later stage. It doesn’t provide immediate feedback and is suitable for scenarios where immediate confirmation of license initialization is not required.

  • When immediately is true, this returns a promise that resolves when the operation finishes. It does not provide any value upon resolution. Please note that it may raise up license related exceptions.

Code snippet

Dynamsoft.License.LicenseManager.initLicense("your-license-key", true)
  .then(result => {
    if (result?.message) {
      console.log("License Message:", result.message);
    } else {
      console.log("License initialized successfully");
    }
  })
  .catch(error => {
    console.error("License initialization failed:", error);
  });

setDeviceFriendlyName

Assigns a distinctive name to the device, correlating it with its UUID.

Please be aware that this method must be called before Dynamsoft.CVR.CaptureVisionRouter.createInstance() or Dynamsoft.Core.CoreModule.loadWasm() or Dynamsoft.DCP.CodeParser.createInstance() to take effect.

static setDeviceFriendlyName(name: string): void;

Parameters

name: A string representing the device which is easier to recognize than its UUID.

Return Value

void

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version(2.2.10)
  • Version 2.x
    • Version 2.0.30
    • Version 2.0.20
    • Version 2.0.10
Change +
© 2003–2024 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support