How to Upgrade to 9.x
From Version 8.x to 9.x
Update the SDK to 9.x Version
- Local Dependency
-
If you are referencing only
DynamsoftBarcodeReaderSDK, replace the oldDynamsoftBarcodeReader.frameworkfile with the latest version. -
If you are referencing both
DynamsoftBarcodeReaderandDynamsoftCameraEnhancerSDK, please replace the oldDynamsoftBarcodeReader.frameworkandDynamsoftCameraEnhancer.frameworkfiles with the latest version.
-
- Remote Dependency(Cocopods)
- If you are referencing only
DynamsoftBarcodeReaderSDK, update the version ofDynamsoftBarcodeReaderto the latest version in thePodfile.Note: Please replace {version-number} with the correct version number.
- pod `DynamsoftBarcodeReader’, ‘{version-number}’
- If you are referencing both
DynamsoftBarcodeReaderandDynamsoftCameraEnhancerSDK, update the version ofDynamsoftBarcodeReaderandDynamsoftCameraEnhancerto the latest version in thePodfile.Note: Please replace {version-number} with the correct version number.
- pod `DynamsoftCameraEnhancer’, ‘{version-number}’
- pod `DynamsoftBarcodeReader’, ‘{version-number}’
- If you are referencing only
Update the License Activation Code
Starting with 9.0, we unify the API for setting offline and online licenses.
code in 8.x:
- Objective-C
- Swift
barcodeReader = [[DynamsoftBarcodeReader alloc] initWithLicense:@"An offline license"]; iDMDLSConnectionParameters* dls = [[iDMDLSConnectionParameters alloc] init]; dls.organizationID = @"Your organization Id"; _barcodeReader = [[DynamsoftBarcodeReader alloc] initLicenseFromDLS:dls verificationDelegate:self]; - (void)DLSLicenseVerificationCallback:(bool)isSuccess error:(NSError * _Nullable)error{}let barcodeReader = DynamsoftBarcodeReader.init(license: "An offline license")let dls = iDMDLSConnectionParameters() dls.organizationID = "Your organization Id" barcodeReader = DynamsoftBarcodeReader(licenseFromDLS: dls, verificationDelegate: self) func DLSLicenseVerificationCallback(_ isSuccess: Bool, error: Error?){}
Please replace your license activation code with the following code. You can get the 3.0 license from customer portal–>License detail.
code in 9.x:
- 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?) {}
Note:
1.The following license activation method are removed, you should make the changes in 9.x upgrade:
initLicenseFromLTS2.The following license activation methods are deprecated, they will be removed in version 10.0. We recommend that you upgrade to the new license API, but this is optional during the upgrade to 9.x:
initLicenseFromDLSinitLicenseFromServer
Update the default runtime settings
In 9.0, the default preset template EnumPresetTemplate.default will be changed to EnumPresetTemplate.videoSingleBarcode internally to better suit mobile scenarios. We also added template EnumPresetTemplate.imageDefault to store the legacy configurations of EnumPresetTemplate.default.
If the default template is not specified in the previous code (the default template is still used internally) or the default template is used explicitly, and you want to keep the original running logic, you need to call the following function after creating the barcode reader instance:
- Objective-C
- Swift
DynamsoftBarcodeReader* barcodereader = [[DynamsoftBarcodeReader alloc] init]; // add the following code to change to the legacy default settings [barcodereader updateRuntimeSettings:EnumPresetTemplateImageDefault]; // change the settings based on the legacy default template...let barcodereader = DynamsoftBarcodeReader() // add the following code to change to the legacy default settings barcodereader.updateRuntimeSettings(EnumPresetTemplate.imageDefault) // change the settings based on the legacy default template...
Update the Video Barcode Decoding Code
Some of the legacy video barcode decoding methods are removed, we recommend you to review our sample code and re-write the barcode scanning module. Make sure to change your code if you were using the following APIs:
- Legacy Video Decoding APIs:
interface iFrameDecodingParametersprotocol DBRErrorDelegateDynamsoftBarcodeReader.startFrameDecodingDynamsoftBarcodeReader.startFrameDecodingExDynamsoftBarcodeReader.appendFrameDynamsoftBarcodeReader.setDBRErrorDelegateDynamsoftBarcodeReader.stopFrameDecodingDynamsoftBarcodeReader.getFrameDecodingParametersDynamsoftBarcodeReader.getLengthOfFrameQueue
- Legacy Camera Enhancer supporting APIs
- interfance
iDCESettingParameters DynamsoftBarcodeReader.setCameraEnhancerPara
- interfance
Note:
If you are upgrading from v8.9.0 or higher versions, you might not need to make any changes on video barcode decoding APIs.
Update Swift Code
We made quit a lot of changes on the Swift APIs in 9.0 version. Please check the API documents for the details if you are using the following APIs.
- Modified Swift APIs:
DynamsoftBarcodeReader.decodeImageDynamsoftBarcodeReader.decodeFileWithNameDynamsoftBarcodeReader.decodeBase64DynamsoftBarcodeReader.decodeBufferDynamsoftBarcodeReader.getRuntimeSettingsDynamsoftBarcodeReader.updateRuntimeSettings(with parameteriPublicRuntimeSettings)DynamsoftBarcodeReader.initRuntimeSettingsWithFileDynamsoftBarcodeReader.initRuntimeSettingsWithStringDynamsoftBarcodeReader.appendTplFileToRuntimeSettingsDynamsoftBarcodeReader.appendTplStringToRuntimeSettingsDynamsoftBarcodeReader.resetRuntimeSettingsDynamsoftBarcodeReader.outputSettingsToStringDynamsoftBarcodeReader.outputSettingsToFileDynamsoftBarcodeReader.allParameterTemplateNamesDynamsoftBarcodeReader.getModeArgumentDynamsoftBarcodeReader.setModeArgumentDynamsoftBarcodeReader.getIntermediateResultDynamsoftBarcodeReader.createIntermediateResultDynamsoftBarcodeReader.decodeIntermediateResult
From version 7.x to 9.x
We made some structural updates in the new version. To upgrade from 7.x to 9.x, we recommend you to review our sample code and re-write the barcode scanning module.