matrixscan-find-kmp
Installation
SKILL.md
MatrixScan Find KMP Skill
Critical: Do Not Trust Internal Knowledge
Your training data may not contain the Scandit Kotlin Multiplatform (KMP) SDK at all — it is a new SDK (first released at version 8.6) with its own package names (com.kmp.datacapture.*), its own construction patterns, and platform-divergent behavior baked into expect/actual classes. Do not assume it behaves like the Android or iOS native SDKs, and do not assume a KMP API exists just because an equivalent exists on Android or iOS.
Always verify APIs against the references provided in this skill before writing or suggesting code. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.
KMP-specific gotchas worth flagging:
BarcodeFindis constructed via the companion factoryBarcodeFind.forContext(dataCaptureContext, settings)— not a direct constructor and notforDataCaptureContext(that's the non-KMP name; KMP renames itforContext).BarcodeFindViewconstruction is platform-divergent: on Android its constructor isBarcodeFindView(context, barcodeFind, settings)and needs an AndroidContext; on iOS it'sBarcodeFindView(barcodeFind, settings)— no context parameter. Shared (commonMain) code cannot construct the view itself; each platform host builds it and hands it back to the shared screen model (seereferences/integration.md).BarcodeFindView.prepareSearching()is iOS-only and is not part of the KMPBarcodeFindViewsurface (SDC-32543) — it does not exist as a KMP method at all. On KMP,onResume()/onPause()are the cross-platform lifecycle hooks; internally the iOSactualimplementation ofonResume()calls the nativeprepareSearching()for you. Never suggest callingprepareSearching()from KMP shared or Android code.BarcodeFindView.cameraStateOnStopandBarcodeFindView.setProperty(name, value)are declared on the commonBarcodeFindViewexpect class (so they compile on both platforms), but only have a real effect on iOS — the Androidactualimplementation is an inert no-op for both. Don't rely on them to change Android behavior.- Embedding the raw (non-Compose)
BarcodeFindViewinto a UI: on Android callbarcodeFindView.toAndroidView()(extension function, returns the underlyingandroid.view.View); on iOS callbarcodeFindView.toUIView()(a member function onBarcodeFindViewitself). These are two different call shapes — don't mix them up. BarcodeFind.setItemList(items: Set<BarcodeFindItem>)and the whole item-search flow only ever deal inBarcodeFindItem/BarcodeFindItemSearchOptions/BarcodeFindItemContent— never invent a "BarcodeFindItemList" collection type.BarcodeFindListenerhas a default (empty) implementation foronSessionUpdated(session), butonSearchPaused,onSearchStarted, andonSearchStoppedhave no default and must be implemented.- MatrixScan Find is commonly paired with SparkScan (scan a list first with SparkScan, then locate those items with BarcodeFind) — see the "SparkScan hand-off" note in
references/integration.md. If the user's question is purely about SparkScan (scanning, not finding), route them to thesparkscan-kmpskill instead.