layout | title | description | keywords | needAutoGenerateSidebar | noTitleIndex | multiProgrammingLanguage | enableLanguageSelection | ignore | permalink |
---|---|---|---|---|---|---|---|---|---|
default-layout |
License Methods - Dynamsoft Barcode Reader iOS API Reference |
This page shows License methods of Dynamsoft Barcode Reader for iOS SDK. |
initWithLicense, initWithLicenseFromServer, outputLicenseToString, license methods, api reference, objective-c, oc, swift |
true |
true |
true |
true |
true |
/programming/objectivec-swift/api-reference/primary-license.html |
Method | Description |
---|---|
initLicense |
Initialize license for DynamsoftBarcodeReader . |
setDeviceFriendlyName |
Sets a human-readable name that identifies the device. |
Initializes DynamsoftBarcodeReader
with a license.
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. ```objc [DynamsoftBarcodeReader initLicense:@"Put your license here" verificationDelegate: self]; - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError *)error{ } ``` 2. ```swift DynamsoftBarcodeReader.initLicense("Put your license here", verificationDelegate: self) func dbrLicenseVerificationCallback(_ isSuccess: Bool, error: Error?) { } ```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. ```objc + (BOOL)setDeviceFriendlyName:(NSString *_Nullable)name error:(NSError *_Nullable *_Nullable)error; ``` 2. ```swift 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. ```objc [DynamsoftBarcodeReader setDeviceFriendlyName:@"Put your device name here" error:&error]; ``` 2. ```swift do{ try DynamsoftBarcodeReader.setDeviceFriendlyName("Put your device name here") }catch{ // Add your code to deal with exceptions } ```