About matrixscan-batch-ios
A coding skill for integrating, upgrading, and replacing Scandit MatrixScan Batch in iOS apps. It emphasizes checking documented APIs and accounting for iOS-specific setup and lifecycle details.
Key features
- 01iOS BarcodeBatch integration guidance
- 02SDK migration guidance
- 03Third-party scanner migration guidance
- 04API verification and reference routing
- 05Licence-key setup guidance
Use cases
- 01Adding BarcodeBatch to a UIKit or SwiftUI app
- 02Migrating an existing Scandit SDK integration
- 03Replacing another multi-barcode scanner
- 04Checking API usage and lifecycle details
MCP support
The skill describes using the remote Scandit MCP server to provision and retrieve trial licence keys, if connected.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ scandit/ skills --skill matrixscan-batch-iosAfter installing, type/matrixscan-batch-iosin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/integration.mdmigration.mdthird-party-migration.mdDetails
From the project READMEMatrixScan Batch iOS Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit SDK APIs. The BarcodeBatch API changes between major SDK versions — initializer signatures, overlay constructors, and delegate method names have all evolved (e.g. BarcodeTracking → BarcodeBatch).
Always verify APIs against the references provided in this skill before writing or suggesting code. Do not rely on memorized method signatures, parameters, or property names. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.
iOS-specific gotchas worth flagging:
BarcodeBatch(context: context, settings: settings)is a direct convenience initializer — not a factory method like Android'sBarcodeBatch.forDataCaptureContext(...). Passing a non-nil context auto-attaches the mode to the context.- Camera setup is manual: get
Camera.default, callcontext.setFrameSource(camera, completionHandler: nil), thencamera?.apply(BarcodeBatch.recommendedCameraSettings, completionHandler: nil). Drive the camera fromviewWillAppear/viewWillDisappear. BarcodeBatchListener.barcodeBatch(_:didUpdate:frameData:)is called on a background queue — not the main thread. Dispatch UI work viaDispatchQueue.main.async {}.- Do not hold references to
BarcodeBatchSession.trackedBarcodes,addedTrackedBarcodes,updatedTrackedBarcodes, orremovedTrackedBarcodesoutside the callback — copy the data before the callback returns. BarcodeBatchBasicOverlay(barcodeBatch:view:)andBarcodeBatchAdvancedOverlay(barcodeBatch:view:)auto-add the overlay to theDataCaptureView— no separateaddOverlaycall needed.DataCaptureViewmust beaddSubview'd manually — unlikeBarcodeArView,DataCaptureViewdoes not auto-attach to a parent view.- Per-barcode brush customization (
barcodeBatchBasicOverlay(_:brushFor:),setBrush(_:for:)) requires the MatrixScan AR add-on license. A uniform default brush (no delegate) does not. - BarcodeBatchAdvancedOverlay requires the MatrixScan AR add-on license.
- No built-in feedback —
BarcodeBatchnever plays a sound or vibrates on its own (unlikeBarcodeCapture/SparkScan). Emit feedback manually withFeedback.default.emit()from inside the listener callback (dispatched to the main thread), gated onsession.addedTrackedBarcodesso it doesn't beep every frame. session.removedTrackedBarcodesis an[Int]of tracking identifiers (barcodes that left the frame) — notTrackedBarcodeobjects.addedTrackedBarcodes/updatedTrackedBarcodesare[TrackedBarcode].- iOS symbology cases are camelCase:
.ean13UPCA,.code128,.qr— notEAN13_UPCA/CODE128/QRlike Android. - iOS delegate methods use Swift naming:
barcodeBatchBasicOverlay(_:didTap:)(not Android'sonTrackedBarcodeTapped),barcodeBatchAdvancedOverlay(_:viewFor:)(notviewForTrackedBarcode). BarcodeBatchAdvancedOverlayDelegateusesUIView— not AndroidViewor SwiftUI views.- SwiftUI:
DataCaptureViewis aUIViewand cannot be dropped into SwiftUI directly. Wrap a UIKit view controller in aUIViewControllerRepresentableand keep all BarcodeBatch APIs inside that view controller. - Cleanup:
BarcodeBatchListeneris held as a weak reference, so a missedremoveListenerwon't leak — but callbarcodeBatch.removeListener(self)indeinitto make the lifecycle explicit. When using the shared singleton (DataCaptureContext.shared), modes stay attached for the app's lifetime — you don't need to callremoveCurrentMode()ordispose(). Those methods do exist onDataCaptureContextif you want to tear down explicitly. DataCaptureContextexposes two valid initializers:DataCaptureContext.initialize(licenseKey:)+.shared(added 7.1.0/7.6.0 — the modern singleton pattern, and what this skill uses) and the olderDataCaptureContext(licenseKey:)convenience init (still non-deprecated, and what the UIKit Get Started page on docs.scandit.com still shows). Prefer the singleton form.
Intent Routing
Based on the user's request, load the appropriate reference file before responding:
- Integrating MatrixScan Batch from scratch, configuring settings, handling tracked barcodes, customizing overlays, adding feedback, or managing lifecycle → read references/integration.md and follow the instructions there. Before writing code, determine whether the project uses UIKit or SwiftUI (check for
import SwiftUI, an@mainAppstruct,SceneDelegate/AppDelegate,.storyboard/.xibfiles, etc.) and use the matching Get Started page from the References table below. If the project already has BarcodeBatch wired up, do not re-create the context, mode, view, or lifecycle — locate the existing ones (grep forBarcodeBatch, thenDataCaptureView) and change only what the user asked for. - Upgrading the Scandit SDK version (e.g. v6→v7, v7→v8, or "upgrade to the latest") → read references/migration.md. The headline v6→v7 change for MatrixScan Batch is the
BarcodeTracking→BarcodeBatchrename; the guide also covers the context/camera modernization. Detect the installed version fromPackage.resolved/Podfile.lockbefore asking the user. - Replacing a different barcode scanner with MatrixScan Batch (AVFoundation
AVCaptureMetadataOutput, VisionKitDataScannerViewController, or another third-party multi-barcode SDK) → read references/third-party-migration.md, then follow references/integration.md for the BarcodeBatch integration.
API Usage Policy
Only use APIs that are explicitly documented in the Scandit references below. Do not invent or guess method signatures, parameters, or property names. If unsure whether an API exists or how it is called — or if a compile error occurs — fetch the relevant reference page before responding. Do not tell the user to check the docs themselves. After answering, always include the relevant link so the user can explore further.
Never construct or guess documentation URLs. When you need a specific class or property's API page:
- First check whether the page you already fetched contains a direct hyperlink to it — topic pages link directly to relevant API symbols. Always request links alongside content in your fetch prompt.
- If no direct link was found, fetch the API index (see Full API reference in the table below), extract the actual link from it, and follow that.
URL structures can vary (e.g. api/ui/ subdirectory) and guessing will lead to 404s.
Licence key
Scanning needs a Scandit licence key. For this skill the licence product is native and the licence platform is ios.
Work through these in order — never block the user on MCP:
-
The Scandit MCP server is connected — call
ensure_scanner_setupwith productnativeand platformsios,app_identifier(the app's bundle or application id; for web, its production domain, neverlocalhost) andenv_varSCANDIT_LICENSE_KEY. Do not run the command it returns. Then callget_license_keywith the key's id, from that result or fromlist_license_keys; iflist_license_keysshows the key is not a trial, ask the user before fetching it. Show at most a masked preview in chat; never print a full key. -
It is not connected — tell the user once that they can connect the remote Scandit MCP server,
https://ssl.scandit.com/mcp, in their MCP client, then continue from step 1. Do not edit MCP client configuration yourself.Authentication is browser-based, so it is not supported headless or in CI. The server provisions trial keys only; it never creates, revokes, or modifies production licences.
-
The user declines, or has no MCP client — they generate a key themselves at https://ssl.scandit.com (no account yet: https://ssl.scandit.com/dashboard/sign-up?p=test) and paste it in.
Then put the key into the code: write it into the licence-key call in place of the placeholder — the key get_license_key returned, or the one the user pastes or gives you — still showing only a masked preview in chat. Do not search the project, its files or the environment for a key.
References
| Topic | Resource |
|---|---|
| UIKit integration | Get Started (UIKit) · Sample |
| SwiftUI integration | Get Started (SwiftUI) |
| AR overlays (BasicOverlay brushes, AdvancedOverlay views) | Adding AR Overlays |
| Version migration (v6→v7→v8) | Migrate 6→7 · Migrate 7→8 |
| Full API reference | BarcodeBatch API |