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
+ (void)initLicense:(nonnull NSString *)license verificationDelegate:(nonnull id<DBRLicenseVerificationListener>)listener NS_SWIFT_NAME(initLicense(_:verificationDelegate:));
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
[DynamsoftBarcodeReader initLicense:@"Put your license here" verificationDelegate: self]; - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError *)error{ }
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
+ (BOOL)setDeviceFriendlyName:(NSString *_Nullable)name error:(NSError *_Nullable *_Nullable)error;
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
[DynamsoftBarcodeReader setDeviceFriendlyName:@"Put your device name here" error:&error];
do{ try DynamsoftBarcodeReader.setDeviceFriendlyName("Put your device name here") }catch{ // Add your code to deal with exceptions }