label-capture-capacitor
Installation
SKILL.md
Label Capture Capacitor Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit Label Capture APIs. The Capacitor plugin surface (ES module imports, initializePlugins(), webViewContentOnTop toggle) is distinct from the web, React Native, Flutter, and Cordova SDKs.
Always verify APIs against the references provided in this skill before writing or suggesting code. Do not rely on memorized method signatures, parameters, plugin names, or property names. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.
Capacitor-specific gotchas worth flagging:
- Plugins must be initialized first. Call
await ScanditCaptureCorePlugin.initializePlugins();beforeDataCaptureContext.initialize(licenseKey). Skipping this step causes plugin-bridge errors at runtime. webViewContentOnToptoggle. The native scan view sits behind the WebView. While scanning, setview.webViewContentOnTop = falseso native overlay UI receives touch events. To show DOM-based UI on top (e.g. a result modal), flip back toview.webViewContentOnTop = true. Forgetting this is the most common cause of "modal/buttons don't work during scanning" or "scan UI is invisible".- Listener method names are iOS-style on Capacitor. The Validation Flow listener uses
didCaptureLabelWithFields(fields),didSubmitManualInputForField(field, oldValue, newValue),didUpdateValidationFlowResult(...). Web names (onValidationFlowLabelCaptured,onManualInput) do not exist on Capacitor. - Class-based field API, same shape as RN/Cordova (and opposite to Flutter).
CustomBarcode.initWithNameAndSymbologies(...),new ExpiryDateText(...),field.optional = false,LabelCaptureSettings.settingsFromLabelDefinitions([...], {}). There is noLabelCaptureSettingsBuilder/LabelDefinitionBuilderand no v8.5 factory-function sugar — those are web-only. - After installing or upgrading Scandit packages, run
npx cap sync(andcd ios/App && pod installfor iOS). - Camera permission: iOS requires
NSCameraUsageDescriptioninios/App/App/Info.plist. Android: declared automatically by the plugin; request at runtime via@capacitor/cameraor@capgo/permissionifminSdkVersion >= 23.
Product Guidance
Apply these rules whenever the user is making a design decision, not just an API question. They reflect how Scandit recommends Label Capture be integrated.