The barcode scanner helper is designed and implemented on iOS on the barcode-scanner branch (gem, native, and platform all have a branch by that name). Android is the missing half.
Already done on that branch:
native_scan_button_tag(label, target:, event:, submit:, formats:) in the gem, plus tests
RubyNative.scan(options) in the JS bridge, dispatching a ruby-native:scan CustomEvent with status: ok | cancelled | error
- iOS
BarcodeScannerViewController wired into both Normal and Advanced, with tests
- A docs page on platform, which currently says "iOS only for now. Android support is coming."
To close this:
- Implement the scanner on Android (zxing is already a dependency, used by the Preview app's
PortraitCaptureActivity) and wire the scan action into the Android bridge
- Map the neutral
formats names (qr, ean13, upce, ...) onto zxing symbologies, ignoring unsupported ones
- Report
error with reason: unsupported | denied rather than crashing when the CAMERA permission is absent
- Drop the "iOS only" line from the docs page
Note the permission gate already works: setting camera usage copy in the dashboard adds NSCameraUsageDescription on iOS and keeps CAMERA in the generated Android manifest. With no copy set, the scanner should report error/unsupported.
All three branches are behind main (20, 32, and 27 commits) and need a rebase first.
The barcode scanner helper is designed and implemented on iOS on the
barcode-scannerbranch (gem, native, and platform all have a branch by that name). Android is the missing half.Already done on that branch:
native_scan_button_tag(label, target:, event:, submit:, formats:)in the gem, plus testsRubyNative.scan(options)in the JS bridge, dispatching aruby-native:scanCustomEvent withstatus: ok | cancelled | errorBarcodeScannerViewControllerwired into both Normal and Advanced, with testsTo close this:
PortraitCaptureActivity) and wire thescanaction into the Android bridgeformatsnames (qr,ean13,upce, ...) onto zxing symbologies, ignoring unsupported oneserrorwithreason: unsupported | deniedrather than crashing when the CAMERA permission is absentNote the permission gate already works: setting camera usage copy in the dashboard adds
NSCameraUsageDescriptionon iOS and keepsCAMERAin the generated Android manifest. With no copy set, the scanner should reporterror/unsupported.All three branches are behind
main(20, 32, and 27 commits) and need a rebase first.