Dev Center
Table of contents

How to set full license in version 8.x

Different methods are used for setting trial and full license keys. In our demo or sample applications, we use .InitLicense() or .ProductKeys to set trial license keys.

For the purchased version, you need to use initLicenseFromDLS() to set the Handshake Codes for your licenses.

You can set the license by following the steps below:

  1. Activate the license
  2. Configure the license (optional)
  3. Set the license in the code

Activate the license

Once you purchase a full license from our online store, you can find your license information at Customer Portal.

To activate the license, click “Please first activate the license”.

FullLicenseList

On the next page, set an Alias for your license or leave the default Alias and click the “Activate” button.

Read more on What is an Alias

SetAlias

On the following popup window, click the “OK” button.

ActivationContinue

Then you can see the message “Activation secceeded!…”. Click “configure this new license item at this page” to continue.

ConfigLicense

You can repeat the above steps to activate other license keys.

Configure the license (optional)

After the license is activated, the Handshake Code will be generated automatically. Read more on What is a Handshake Code.

Basically, you can skip the step. But if you would like to edit the Handshake Codes for the license or view the statistics of a handshake code, please refer to how to manage the handshake code.

Set the license in the code

  • Javascript
  • C
  • C++
  • C#
  • Java
  • Objective-C
  • Swift
  • Java-Android
  • Python
  1.   // Please replace the organizationID with your own
      Dynamsoft.DBR.BarcodeReader.organizationID = "YOUR-ORGANIZATION-ID";
      let reader = await Dynamsoft.DBR.BarcodeReader.createInstance();
    
  2.   char errorBuf[512];
      DMDLSConnectionParameters parameters;
      DBR_InitDLSConnectionParameters(&parameters);
      // Please replace the organizationID with your own
      parameters.organizationID = "YOUR-ORGANIZATION-ID"; 
      DBR_InitLicenseFromDLS(&parameters, errorBuf, 512);
    
  3.   int iRet = -1;
      char szErrorMsg[256];
      DM_DLSConnectionParameters dlspar;    
      CBarcodeReader::InitDLSConnectionParameters(&dlspar);
      // Please replace the organizationID with your own
      dlspar.organizationID = "YOUR-ORGANIZATION-ID"; 
      iRet = CBarcodeReader::InitLicenseFromDLS(&dlspar, szErrorMsg, 256);
      if (iRet != DBR_OK)
       {
       printf("Error code: %d. Error message: %s\n", iRet, szErrorMsg);
       return -1;
       }
    
  4.   DMDLSConnectionParameters dlspar = BarcodeReader.InitDLSConnectionParameters();           
      // Please replace the organizationID with your own
      dlspar.OrganizationID = "YOUR-ORGANIZATION-ID"; 
      EnumErrorCode iRet = BarcodeReader.InitLicenseFromDLS(dlspar, out strErrorMSG);
    
  5.   DMDLSConnectionParameters dlspar = BarcodeReader.initDLSConnectionParameters();
      // Please replace the organizationID with your own
      dlspar.organizationID = "YOUR-ORGANIZATION-ID"; 
      BarcodeReader.initLicenseFromDLS(dlspar);
    
  6.   iDMDLSConnectionParameters* dls = [[iDMDLSConnectionParameters alloc] init];
      // Please replace the organizationID with your own
      dls.organizationID = @"YOUR-ORGANIZATION-ID"; 
      _dbr = [[DynamsoftBarcodeReader alloc] initLicenseFromDLS:dls verificationDelegate:self];
      - (void)DLSLicenseVerificationCallback:(bool)isSuccess error:(NSError * _Nullable)error
      {
    NSNumber* boolNumber = [NSNumber numberWithBool:isSuccess];
    dispatch_async(dispatch_get_main_queue(), ^{
    [self->m_verificationReceiver performSelector:self->m_verificationCallback withObject:boolNumber withObject:error];
        NSLog(@"ifsuccess : %@",boolNumber);
        NSLog(@"error code: %ld:",(long)error.code);
        NSLog(@"errormsg : %@",error.userInfo);
        //UIImage *image =[UIImage imageNamed:@"AllSupportedBarcodeTypes.bmp"];
        //NSError* errormsg = nil;
        //NSArray* readResult = [_dbr decodeImage:image withTemplate:@"" error:&errormsg];
    });
      }
    
  7.   let dls = iDMDLSConnectionParameters();
      // Please replace the organizationID with your own
      dls.organizationID = "YOUR-ORGANIZATION-ID";
      barcodeReader = DynamsoftBarcodeReader(licenseFromDLS: dls, verificationDelegate: self)
      func dlsLicenseVerificationCallback(_ isSuccess: Bool, error: Error?)
      {
     //TODO add your code for license verification
      }
    
  8.   DBRDLSLicenseVerificationListener dlsListener = new DBRDLSLicenseVerificationListener() {
     @Override
     public void DLSLicenseVerificationCallback(boolean success, Exception error) {
     }
      };
      DMDLSConnectionParameters parameters = new DMDLSConnectionParameters();
      // Please replace the organizationID with your own
      parameters.organizationID = "YOUR-ORGANIZATION-ID"; 
      dbr.initLicenseFromDLS(parameters,dlsListener);
    
  9.   reader = BarcodeReader()
      connection_paras = reader.init_dls_connection_parameters()
      # Please replace the organizationID with your own
      connection_paras.organization_id = "YOUR-ORGANIZATION-ID"
      try:
    error = reader.init_licesne_from_dls(connection_paras)
    if error[0] != EnumErrorCode.DBR_OK:
        print(error[1])
      except BarcodeReaderError as bre:
    print(bre)
    

Code snippet in Xamarin: Please refer to this article.

If you run into any issues, please contact Dynamsoft Support.

Notes:

All license usage data is submitted to the Dynamsoft License Server (DLS) hosted by Dynamsoft. You can

Read more about the mechanism behind license tracking.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version
    • Version 10.x
      • Version 10.2.0
      • Version 10.0.21
      • Version 10.0.20
      • Version 10.0.10
      • Version 10.0.0
    • Version 9.x
      • Version 9.6.42
      • Version 9.6.40
      • Version 9.6.33
      • Version 9.6.32
      • Version 9.6.31
      • Version 9.6.30
      • Version 9.6.20
      • Version 9.6.10
      • Version 9.6.0
      • Version 9.4.0
      • Version 9.2.0
      • Version 9.0.0
    • Version 8.x
      • Version 8.8.0
      • Version 8.6.0
      • Version 8.4.0
      • 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
    • Documentation Homepage
    Change +