Skip to content

feat: support multiple barcode format hints#122

Open
DotHyphon wants to merge 1 commit into
ionic-team:mainfrom
DotHyphon:feat/multi-hint-array
Open

feat: support multiple barcode format hints#122
DotHyphon wants to merge 1 commit into
ionic-team:mainfrom
DotHyphon:feat/multi-hint-array

Conversation

@DotHyphon

@DotHyphon DotHyphon commented Apr 28, 2026

Copy link
Copy Markdown

Adds hints?: CapacitorBarcodeScannerTypeHint[] to CapacitorBarcodeScannerOptions as an additive companion to the existing single hint. When non-empty, hints takes precedence and pre-filters the decoder to that set of formats.

ALL (sentinel 17) anywhere in the list short-circuits to scan-all, matching the single-hint semantic.

Bridge layers (Android/iOS/web) read hints and pass it through to the native libs alongside the legacy hint field. Backward compatible: existing callers passing only hint are unaffected.

Depends on:

This PR cannot ship until both native lib PRs land and are released.

@DotHyphon DotHyphon marked this pull request as ready for review April 28, 2026 00:41
@DotHyphon DotHyphon force-pushed the feat/multi-hint-array branch 2 times, most recently from 087d8d1 to 1cbbe29 Compare April 28, 2026 00:54
@DotHyphon DotHyphon marked this pull request as draft April 28, 2026 00:58
Add `hints?: CapacitorBarcodeScannerTypeHint[]` to
CapacitorBarcodeScannerOptions as an additive companion to the existing
single `hint`. When non-empty, `hints` takes precedence and pre-filters
the decoder to that set of formats, both natively and on web (via
html5-qrcode `formatsToSupport`).

`ALL` (sentinel 17) anywhere in the list short-circuits to scan-all,
matching the single-hint semantic.

Bridge layers (Android/iOS/web) read `hints` and pass it through to the
native libs alongside the legacy `hint` field. Backward compatible:
existing callers passing only `hint` are unaffected.

Note: this PR depends on the corresponding native lib changes:
- OutSystems/OSBarcodeLib-Android (multi-hint support in OSBARCScanParameters)
- OutSystems/OSBarcodeLib-iOS (multi-hint support in OSBARCScanParameters)
@DotHyphon DotHyphon force-pushed the feat/multi-hint-array branch from 1cbbe29 to 53ffb6f Compare April 28, 2026 01:01
@DotHyphon DotHyphon marked this pull request as ready for review April 28, 2026 01:55
@peters97

Copy link
Copy Markdown

This feature would be very much appreciated! In our app we try scan products in the supermarket, but they use both ean 8 and 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants