Skip to content

fix(barcode-scanning): isTorchAvailable always returning false on iOS#320

Open
sah1l wants to merge 1 commit intocapawesome-team:mainfrom
sah1l:fix/ios-is-torch-available
Open

fix(barcode-scanning): isTorchAvailable always returning false on iOS#320
sah1l wants to merge 1 commit intocapawesome-team:mainfrom
sah1l:fix/ios-is-torch-available

Conversation

@sah1l
Copy link
Copy Markdown

@sah1l sah1l commented Feb 13, 2026

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

Summary

  • On iOS, isTorchAvailable() always returned false when called outside an active scan session because it relied on cameraView?.getCaptureDevice(), which is nil when no scan is running.
  • Added a fallback to query the default wide-angle camera device directly when no scan session is active, matching Android's behavior of checking hardware capabilities independently of camera session state.

Fixes #293

Fall back to querying the default camera device when no scan session is
active, matching Android's behavior of checking hardware capabilities
independently of camera session state.

Fixes capawesome-team#293
@robingenz
Copy link
Copy Markdown
Member

Please restore the original PR template and fill out the checklist.

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.

BarcodeScanner isTorchAvailable always returning {"available":false} on IOS

3 participants