Skip to main content

Migrate from 7.x to 8.x

This guide will help you migrate from versions 7.x of the Scandit Smart Data Capture SDK to version 8.x.

Version 8.0 deprecates and removes many APIs from versions 7.x, as well as making many of the existing APIs more intuitive, resulting in a simpler and quicker integration experience.

While not all features and functionalities are impacted, it is likely you will need to modify your app. If you are unsure about how to perform the migration or the feature you are using is not covered in this migration guide, please reach out to our support team.

Updating for Deprecated APIs​

Version 5.x/6.x Users

If your app is still using version 5.x or 6.x of the Scandit Barcode Scanner SDK, you will need to first migrate to version 6.x and/or 7.x before migrating to version 8.x. Please refer to the migration guide from 5.x to 6.x and migration guide from 6.x to 7.x for more information.

Version 8.0 includes the removal of all APIs that were deprecated throughout the 7.x series. For the simplest migration process, we recommend you:

  • Update your app to the latest 7.6.x version. This version includes warnings for all deprecated APIs.
  • Address all deprecation warnings in your app.
  • Update to version 8.0.

Barcode Capture Changes​

Core​

In this release, VideoResolution::Auto has been now deprecated. Please use the respective capture mode's recommendedCameraSettings for the best results.

Smart Label Capture​

The properties of the LabelFieldDefinition API have been renamed to better reflect their purpose:

Old Property NameNew Property Name
patternvalueRegex
patternsvalueRegexes
dataTypePatternanchorRegex
dataTypePatternsanchorRegexes

SparkScan​

In version 7.0, we are introducing the second generation of our ready-to-use barcode scanning UI, SparkScan. This new UI is more intuitive and provides a more modern look and feel, as well as bringing more customization options.

Version 8.0 removes the SparkScan APIs that version 7 deprecated:

  • The SparkScanViewHandMode enum and SparkScanViewSettings.defaultHandMode.
  • The SparkScanView properties torchButtonVisible, handModeButtonVisible, stopCapturingText, startCapturingText, resumeCapturingText, scanningCapturingText, captureButtonBackgroundColor, captureButtonActiveBackgroundColor and captureButtonTintColor.
  • The matching SparkScanViewDefaults properties: DefaultHandModeButtonVisible, DefaultTorchButtonVisible, DefaultStopCapturingText, DefaultStartCapturingText, DefaultResumeCapturingText, DefaultScanningCapturingText, DefaultCaptureButtonActiveBackgroundColor, DefaultCaptureButtonBackgroundColor and DefaultCaptureButtonTintColor.

Version 8.0 also changes the default highlight brush in SparkScan.

Building on the second generation of SparkScan, version 8.0 expands SparkScan beyond barcode scanning to include support for scanning any combination of barcodes and text present on a target. The feature is available in beta at the moment, please contact Scandit Support if you are interested in trying it out.

Cross-Platform Framework Changes (Capacitor, Cordova, React Native, Flutter)​

Version 7.6 deprecated the factory methods that create a capture mode or overlay and attach it in the same call, and version 8.0 removes them. Code that still calls them does not compile against 8.0. Create the mode or overlay with its constructor and attach it yourself.

Removed in 8.0Replacement
forContext(context, settings) on BarcodeCapture, BarcodeBatch, BarcodeCount, BarcodeSelection, BarcodeAr, IdCapture and LabelCaptureThe mode's constructor, then context.setMode(mode)
BarcodeFind.forContext(context, settings) (Capacitor, Cordova, React Native)new BarcodeFind(settings)
SparkScan.forSettings(settings) (Capacitor, Cordova, React Native)new SparkScan(settings)
Parser.forContextAndFormat(context, dataFormat)Parser.create(dataFormat)
The overlay with… factories, such as BarcodeCaptureOverlay.withBarcodeCaptureForView(mode, view)The overlay's constructor, then view.addOverlay(overlay)

Before (7.x):

const barcodeCapture = BarcodeCapture.forContext(context, settings);
const overlay = BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view);

After (8.x):

const barcodeCapture = new BarcodeCapture(settings);
context.setMode(barcodeCapture);

const overlay = new BarcodeCaptureOverlay(barcodeCapture);
view.addOverlay(overlay);

setMode removes any mode already attached to the context before adding the new one. Use context.addMode(mode) instead if you need to keep the existing modes.

For Flutter (Dart), the constructors are called without new:

var barcodeCapture = BarcodeCapture(settings);
context.setMode(barcodeCapture);

var overlay = BarcodeCaptureOverlay(barcodeCapture);
view.addOverlay(overlay);

The view factories DataCaptureView.forContext and SparkScanView.forContext are not affected and remain available in 8.0.

ID Capture Changes​

The ID Capture and Validation API was completely redesigned in version 7.0, and version 8.0 builds on those changes with the following improvements:

  • Added ElementsToRetain to MobileDocumentScanner: The set of data elements that the application intends to retain from scanned mobile documents. This information is used to set the IntentToRetain flag in ISO 18013-5 mdoc requests, which is required for legal compliance with data protection standards. An empty set indicates no elements will be retained, and IntentToRetain will be set to false for all fields.
  • ID Capture now supports full-frame anonymization.
  • The result of decodeMobileDriverLicenseViz, which is currently returned as part of the VizResult within CapturedId, will now be provided through a new field named mobileDocumentOcr.
  • Added CapturedId::isCitizenPassport, which indicates whether the passport was issued to a citizen of the issuing country. Returns false for travel documents such as refugee, stateless, or alien passports, and for any passports issued by organizations rather than states.
  • Removed the deprecated API DateResult::toDate. You should use DateResult::toLocalDate or DateResult::toUtcDate instead.

On iOS, IdCaptureSettings.scannerType was replaced by IdCaptureSettings.scanner, which takes an IdCaptureScanner. Wrap the SingleSideScanner or FullDocumentScanner you set before in an IdCaptureScanner:

// 7.x
settings.scannerType = FullDocumentScanner()

// 8.x
settings.scanner = IdCaptureScanner(physicalDocument: FullDocumentScanner())

Web SDK Changes​

Starting with version 8.0, there are some critical changes in the Web SDK that you should be aware of:

.NET SDK Changes​

In version 8.0 we have fundamentally redesigned the Scandit .NET SDK's architecture to better align with the modern .NET ecosystem. This redesign brings several key benefits:

The SDK now includes generic .net8.0 and .net9.0 targets. This allows you to reference Scandit.DataCapture.Core and related packages directly from non-UI projects, such as class libraries or unit test projects, making it significantly easier to build modular, testable applications following principles like Clean Architecture.

Due to the architectural changes, the SDK now requires explicit initialization at application startup. The public API has not changed, but you must add the corresponding initialization code to your application for the SDK to function correctly.

In your MainApplication.cs, add the initialization calls within the OnCreate method.

[Application]
public class MainApplication(IntPtr handle, JniHandleOwnership ownership) : Application(handle, ownership)
{
public override void OnCreate()
{
base.OnCreate();

// Initialize Scandit libraries
ScanditCaptureCore.Initialize();
ScanditBarcodeCapture.Initialize();
}
}
tip

When using additional components like ScanditIdCapture or ScanditParser in your MAUI application, you must initialize them as well. Please add the required Initialize() call within your startup file following the pattern shown in the example above.

Xamarin SDK Changes​

Starting this release we are no longer upgrading Xamarin and Forms solutions for the Data Capture SDK. Microsoft ended support for these frameworks on May 1, 2024, which locks them into discontinued tooling. You may continue to use the latest releases of SDK version 7.x as per our support policy.