Speed up MatrixScan Count integration with Agent Skills
Install the Scandit plugin and use the /matrixscan-count-cordova skill so that your AI coding agent can integrate, debug, and customize MatrixScan Count on Cordova following Scandit's recommended patterns. More info →
Run the following command in your project directory. It detects the supported coding agents you have installed and adds the Scandit plugin to each. Re-run it to update.
npx plugins add scandit/skillsPrefer to set it up yourself? Manual installation steps for each agent →
Get Started
In this guide you will learn step-by-step how to add MatrixScan Count to your application.
The general steps are:
- Initialize the Data Capture Context
- Configure the Barcode Count Mode
- Obtain camera instance and set frame source used
- Register the listener to be informed when scanned phase is over
- Set capture view and AR overlays
- Set up the camera so that it switches on when you are in scanning view
- Store and retrieve scanned barcodes
- Reset Barcode Count mode
- List and Exit callbacks
Initialize the Data Capture Context
The first step to add capture capabilities to your application is to initialize the Data Capture Context with a valid Scandit Data Capture SDK license key.
DataCaptureContext.initialize('-- ENTER YOUR SCANDIT LICENSE KEY HERE --');
DataCaptureContext should be initialized only once. Use DataCaptureContext.sharedInstance to access it afterwards.
Configure The Barcode Count Mode
The main entry point for the Barcode Count Mode is the BarcodeCount object. It is configured through BarcodeCountSettings and allows you to register one or more listeners that are informed whenever a scan phase has finished.
For this tutorial, we will set up Barcode Count for tracking EAN13 codes. Change this to the correct symbologies for your use case (for example, Code 128, Code 39…).
const settings = new Scandit.BarcodeCountSettings();
settings.enableSymbologies([Scandit.Symbology.EAN13UPCA]);
If you are sure that your environment will only have unique barcodes (i.e. no duplicated values), you can also enable BarcodeCountSettings.expectsOnlyUniqueBarcodes. This option improves scanning performance as long as you are sure that no duplicates will be present. Next, create a BarcodeCount instance with the Data Capture Context and the settings initialized in the previous step:
const barcodeCount = new Scandit.BarcodeCount(settings);
DataCaptureContext.sharedInstance.addMode(barcodeCount);