Dev Center
Swift
Objective-C
Table of contents

How to Upgrade

From Version 9.x to 10.x

Dynamsoft Barcode Reader SDK has been refactored to integrate with DynamsoftCaptureVision (DCV) architecture. To upgrade from version 9.x or earlier to 10.x, we recommend you to follow the User Guide and re-write your codes.

Update the Libraries to 10.x Version

The Dynamsoft Barcode Reader SDK has been split into multiple libraries from the previous single library, and the dependency of the xcframeworks need to be updated.

  • Local Dependency Add the following xcframework files into your project:

    • DynamsoftCaptureVisionRouter.xcframework
    • DynamsoftBarcodeReader.xcframework
    • DynamsoftImageProcessing.xcframework
    • DynamsoftCore.xcframework
    • DynamsoftLicense.xcframework
    • DynamsoftCameraEnhancer.xcframework(optional)

      dependencies {
          implementation fileTree(include: ['*.aar'], dir: 'libs')   
      }
      

Note: From DBR v10.0, frameworks are no longer provided in the SDK. Use xcframeworks instead.

  • Remote Dependency(CocaPods) update Podfile:

      target 'HelloWorld' do
         use_frameworks!
    
      pod 'DynamsoftBarcodeReaderBundle','{version-number}'
        
      end
    

    Note: Please view user guide for the correct version number.

Update the License Activation Code

Starting from 10.0, we have unified the API for setting licenses across different Dynamsoft products.

Old APIs New APIs
BarcodeReader.initLicense DSLicenseManager.initLicense
  • Code in 9.x:
  • Objective-C
  • Swift
[DynamsoftBarcodeReader initLicense:@"YOUR-LICENSE-KEY" verificationDelegate:self];
- (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError *)error
{
  // Add your code for license verification.
}
DynamsoftBarcodeReader.initLicense("YOUR-LICENSE-KEY", verificationDelegate: self)
func dbrLicenseVerificationCallback(_ isSuccess: Bool, error: Error?)
{
  // Add your code for license verification.
}
  • Code in 10.x:
  • Objective-C
  • Swift
[DSLicenseManager initLicense:@"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" verificationDelegate:self];
- (void)onLicenseVerified:(BOOL)isSuccess error:(nullable NSError *)error {
    if (!isSuccess && error != nil) {
        NSLog(@"error: %@", error);
    }
}
LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", verificationDelegate: self)
func onLicenseVerified(_ isSuccess: Bool, error: Error?) {
   if !isSuccess {
          if let error = error {
             print("\(error.localizedDescription)")
          }
   }
}

Update Single Image Decoding APIs

The APIs for decoding single image has been adjusted as follows:

Old APIs New APIs
BarcodeReader.decodeFile DSCaptureVisionRouter.captureFromFile
BarcodeReader.decodeFileInMemory DSCaptureVisionRouter.captureFromFileBytes
BarcodeReader.decodeBuffer DSCaptureVisionRouter.captureFromBuffer
BarcodeReader.decodeBufferedImage DSCaptureVisionRouter.captureFromImage
class TextResult class BarcodeResultItem
BarcodeReader.decodeBase64String Currently not available.

Update Video Streaming Decoding APIs

The APIs for decoding video frames has been adjusted as follows:

Old APIs New APIs
BarcodeReader.setImageSource DSCaptureVisionRouter.setInput
BarcodeReader.startScanning DSCaptureVisionRouter.startCapturing
BarcodeReader.stopScanning DSCaptureVisionRouter.stopCapturing
BarcodeReader.setTextResultListener DSCaptureVisionRouter.addResultReceiver
BarcodeReader.setIntermediateResultListener DSCaptureVisionRouter.IntermediateResultManager.addResultReceiver
BarcodeReader.set/getMinImageReadingInterval SimplifiedCaptureVisionSettings.minImageCaptureInterval
BarcodeReader.enableResultVerification DSMultiFrameResultCrossFilter.enableResultCrossVerification
BarcodeReader.enableDuplicateFilter DSMultiFrameResultCrossFilter.enableResultDeduplication
Protocol ImageSource Class DSImageSourceAdapter
Protocol TextResultListener Protocol DSCapturedResultReceiver
Protocol IntermediateResultListener Protocol DSIntermediateResultReceiver
class TextResult class DSBarcodeResultItem

Migrate Your Templates

The template system is upgraded. The template you used for the previous version can’t be directly recognized by the new version. Please download the TemplateConverter tool or contact us to upgrade your template.

The template-based APIs have been updated as follows:

Old APIs New APIs
BarcodeReader.initRuntimeSettingsWithFile DSCaptureVisionRouter.initSettingsFromFile
BarcodeReader.initRuntimeSettingsWithString DSCaptureVisionRouter.initSettings
BarcodeReader.outputSettingsToFile DSCaptureVisionRouter.outputSettingsToFile
BarcodeReader.outputSettingsToString DSCaptureVisionRouter.outputSettings
BarcodeReader.resetRuntimeSettings DSCaptureVisionRouter.resetSettings
BarcodeReader.appendTplFileToRuntimeSettings Not available.
BarcodeReader.appendTplStringToRuntimeSettings Not available.

Migrate Your PublicRuntimeSettings

The class PublicRuntimeSettings has been refactored. It retains commonly used properties while removing the previously complex property settings, which are now exclusively supported through templates.

The APIs for accessing and updating PublicRuntimeSettings has been adjusted as follows:

Old APIs New APIs
BarcodeReader.getRuntimeSettings DSCaptureVisionRouter.getSimplifiedSettings
BarcodeReader.updateRuntimeSettings DSCaptureVisionRouter.updateSettings

Migrate to SimplifiedCaptureVisionSettings

The following properties are replaced by similar properties under DSSimplifiedCaptureVisionSettings. They can also be set via a template file(String).

PublicRuntimeSettings Property SimplifiedCaptureVisionSettings Property Template File Parameter
region roi & roiMeasuredInPercentage TargetROIDef.Location.Offset
timeout timeout CaptureVisionTemplates.Timeout

Migrate to SimplifiedBarcodeReaderSettings

The following properties are replaced by similar properties under DSSimplifiedBarcodeReaderSettings. The majority of them can also be set via a template file(String).

PublicRuntimeSettings Property SimplifiedBarcodeReaderSettings Property Template File Parameter
minBarcodeTextLength minBarcodeTextLength BarcodeFormatSpecification.BarcodeTextLengthRangeArray
minResultConfidence minResultConfidence BarcodeFormatSpecification.MinResultConfidence
localizationModes localizationModes BarcodeReaderTaskSetting.LocationModes
expectedBarcodesCount expectedBarcodesCount BarcodeReaderTaskSetting.ExpectedBarcodesCount
barcodeFormatIds barcodeFormatIds BarcodeReaderTaskSetting.BarcodeFormatIds
barcodeFormatIds_2 barcodeFormatIds BarcodeReaderTaskSetting.BarcodeFormatIds
deblurModes deblurModes BarcodeReaderTaskSetting.DeblurModes
deblurLevel deblurModes BarcodeReaderTaskSetting.DeblurModes
maxAlgorithmThreadCount maxThreadsInOneTask BarcodeReaderTaskSetting.MaxThreadsInOneTask

Remarks:

  • The 2 groups of barcode formats are merged.
  • DeblurLevel is deprecated. You can use DeblurModes instead.
FurtherModes Property SimplifiedBarcodeReaderSettings Property Template File Parameter
grayscaleTransformationModes grayscaleTransformationModes ImageParameter.GrayscaleTransformationModes
imagePreprocessingModes grayscaleEnhancementModes ImageParameter.GrayscaleEnhancementModes
scaleDownThreshold scaleDownThreshold ImageParameter.ScaleDownThreshold

Remarks: The mode IPM_MORPHOLOGY of imagePreprocessingModes is migrated to BinarizationModes. The mode arguments MorphOperation, MorphOperationKernelSizeX, MorphOperationKernelSizeY, MorphShape are now available for all modes of BinarizationModes.

Migrate to Template File

The following properties can only be set via a template file. Please contact us so that we can help you to transform your current settings to a new template file.

PublicRuntimeSettings Property Template File Parameter
binarizationModes ImageParameter.BinarizationModes
textResultOrderModes BarcodeReaderTaskSetting.TextResultOrderModes
returnBarcodeZoneClarity BarcodeReaderTaskSetting.ReturnBarcodeZoneClarity
scaleUpModes ImageParameter.ScaleUpModes
barcodeZoneMinDistanceToImageBorders BarcodeFormatSpecification.BarcodeZoneMinDistanceToImageBorders
terminatePhase BarcodeReaderTaskSetting.TerminateSettings
PublicRuntimeSettings.furtherModes Property Template File Parameter
colourConversionModes ImageParameter.ColourConversionModes
regionPredetectionModes ImageParameter.RegionPredetectionModes
textureDetectionModes ImageParameter.TextureDetectionModes
textFilterModes ImageParameter.TextDetectionMode & ImageParameter.IfEraseTextZone
dpmCodeReadingModes BarcodeReaderTaskSetting.DPMCodeReadingModes
deformationResistingModes BarcodeReaderTaskSetting.DeformationResistingModes
barcodeComplementModes BarcodeReaderTaskSetting.BarcodeComplementModes
barcodeColourModes BarcodeReaderTaskSetting.BarcodeColourModes

Migrate to Other APIs

The Intermediate Result system is redesigned and the following properties are deprecated.

PublicRuntimeSettings Property
intermediateResultTypes
intermediateResultSavingMode

Removed

The following properties are removed.

PublicRuntimeSettings Property
resultCoordinateType
FurtherModes Property
colourClusteringModes

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.2.10
    • Version 10.0.21
    • Version 10.0.20
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.11
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.11
    • Version 9.2.10
    • Version 9.0.2
    • Version 9.0.1
    • Version 9.0.0
    • Version 9.6.40
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.13
    • 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 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
    • Version 7.6.0
    • Version 7.5.0
Change +