Dev Center
Swift
Objective-C
Table of contents

License Methods

Method Description
initLicense Initialize license for DynamsoftBarcodeReader.
setDeviceFriendlyName Sets a human-readable name that identifies the device.

initLicense

Initializes DynamsoftBarcodeReader with a license.

  • Objective-C
  • Swift
  1. + (void)initLicense:(nonnull NSString *)license verificationDelegate:(nonnull id<DBRLicenseVerificationListener>)listener 
    NS_SWIFT_NAME(initLicense(_:verificationDelegate:));
    
  2. class func initLicense(_ license: String, verificationDelegate listener: DBRLicenseVerificationListener)
    

Parameters

[in] license The license key. [in, out] verificationDelegate The listener that handles callback when the license verification message is returned by the license server. See also DBRLicenseVerificationListener.

Return Value

The instance of DynamsoftBarcodeReader.

Code Snippet

  • Objective-C
  • Swift
  1. [DynamsoftBarcodeReader initLicense:@"Put your license here" verificationDelegate: self];
    - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError *)error{
    }
    
  2. DynamsoftBarcodeReader.initLicense("Put your license here", verificationDelegate: self)
    func dbrLicenseVerificationCallback(_ isSuccess: Bool, error: Error?) {
    }
    

setDeviceFriendlyName

Sets a human-readable name that identifies the device. This name will appear in the device details table when you check the statistics of the according license.

  • Objective-C
  • Swift
  1. + (BOOL)setDeviceFriendlyName:(NSString *_Nullable)name error:(NSError *_Nullable *_Nullable)error;
    
  2. class func setDeviceFriendlyName(_ name: String?) throws
    

Parameters

[in] name The user-defined device name.
[in,out] error: A pointer to an error object.

An error occurs when:

  • Failed to set device friendly name.

Return Value

A BOOL value that indicates whether the device name setting is approved.

Code Snippet

  • Objective-C
  • Swift
  1. [DynamsoftBarcodeReader setDeviceFriendlyName:@"Put your device name here" error:&error];
    
  2. do{
       try DynamsoftBarcodeReader.setDeviceFriendlyName("Put your device name here")
    }catch{
       // Add your code to deal with exceptions
    }
    

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • 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 +