Skip to content

Fix QR scanner not detecting barcodes on iOS#156

Merged
PureWeen merged 1 commit intomainfrom
fix/qr-scanner-ios-detection
Feb 20, 2026
Merged

Fix QR scanner not detecting barcodes on iOS#156
PureWeen merged 1 commit intomainfrom
fix/qr-scanner-ios-detection

Conversation

@jfversluis
Copy link
Collaborator

Bug

On iOS the QR scanner camera opens but never detects anything — it just stays open with a live preview.

Root Cause

IsDetecting="True" in XAML starts barcode detection during InitializeComponent(), before Options is set in the constructor. On iOS, ZXing.Net.MAUI's native decoder snapshots the options when detection starts and doesn't pick up later changes. So FrameReady fires (camera works) but BarcodesDetected never does (decoder running with default/empty options).

Fix

Set IsDetecting="False" in XAML. Detection now only starts in OnAppearing() — after Options is configured in the constructor and camera permissions are granted. This was the original intent of the 500ms delay + IsDetecting = true in OnAppearing, but the XAML attribute was pre-empting it.

IsDetecting="True" in XAML starts detection during InitializeComponent,
before Options is set in the constructor. On iOS the native decoder
snapshots options at start time and never picks up later changes, so
FrameReady fires but BarcodesDetected never does.

Set IsDetecting="False" in XAML so detection only starts in OnAppearing
(after Options is already configured and permissions are granted).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen merged commit bd88220 into main Feb 20, 2026
6 checks passed
@PureWeen PureWeen deleted the fix/qr-scanner-ios-detection branch February 22, 2026 00:18
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