Dev Center
Swift
Objective-C
Table of contents

License Methods

Method Description
initLicense Read product key and activate the SDK.
initLicenseFromServer Initialize license and connect to the specified server for online verification.
initLicenseFromLicenseContent Initialize license from the license content on client machine for offline verification.
outputLicenseToString Output the license content to a string from the license server.
initLicenseFromLTS Initializes the barcode reader license and connects to the specified server for online verification.

initLicense

Read the product key and activate the SDK.

void initLicense(String license) throws BarcodeReaderException

Parameters

license: The product keys.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initLicense("t0260NwAAAHV***************");

initLicenseFromServer

Initialize the license and connect to the specified server for online verification.

void initLicenseFromServer(String licenseServer, String licenseKey, DBRServerLicenseVerificationListener dbrServerLicenseVerificationListener)

Parameters

licenseServer: The URL of the license server.
licenseKey: The license key.
dbrServerLicenseVerificationListener: The delegate to handle callback when license server returns.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initLicenseFromServer("", "C087****",  new DBRServerLicenseVerificationListener() {
    @Override
    public void licenseVerificationCallback(boolean isSuccess, Exception error) {
    }
});

initLicenseFromLicenseContent

Initialize barcode reader license from the license content on the client machine for offline verification.

void initLicenseFromLicenseContent(String licenseKey, String licenseContent) throws BarcodeReaderException

Parameters

licenseKey: The license key.
licenseContent: An encrypted string representing the license content (quota, expiration date, barcode type, etc.) obtained from the method OutputLicenseToString.

Exceptions

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
//get String licenseContent from reader.outputLicenseToString();
reader.initLicenseFromLicenseContent("C087****",licenseContent);

outputLicenseToString

Output the license content as an encrypted string from the license server to be used for offline license verification.

String outputLicenseToString() throws BarcodeReaderException

Return Value

The output string which stores the contents of license.

Exceptions

BarcodeReaderException

Remark

InitLicenseFromServer has to be successfully called before calling this method.

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initLicenseFromServer("", "C087****",  new DBRServerLicenseVerificationListener() {
    @Override
    public void licenseVerificationCallback(boolean isSuccess, Exception error) {
    }
});
String licenseContent = reader.outputLicenseToString();

initLicenseFromLTS

Initializes the barcode reader license and connects to the specified server for online verification.

void initLicenseFromLTS(DMLTSConnectionParameters ltsInfo, DBRLTSLicenseVerificationListener listener)

Parameters

ltsInfo: The struct DMLTSConnectionParameters with customized settings.
listener: The delegate to handle callback when license server returns.

Code Snippet

BarcodeReader reader = new BarcodeReader();
DMLTSConnectionParameters info = new DMLTSConnectionParameters();
info.organizationID = "200001";
info.sessionPassword = "******";
reader.initLicenseFromLTS(info, new DBRLTSLicenseVerificationListener() {
   @Override
   public void LTSLicenseVerificationCallback(boolean b, Exception e) {
      if (!b && e != null) {
         e.printStackTrace();
      }
   }
});

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

version 8.4.0

  • Latest version (10.2.10)
  • Version 10.x
    • Version 10.0.21
    • Version 10.0.20
  • Version 9.x
    • Version 9.6.20
    • Version 9.6.11
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • Version 9.2.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
  • Version 8.x
    • Version 8.9.3
    • Version 8.9.1
    • Version 8.9.0
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.1
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +