Skip to content

Android support for native_scan_button_tag #78

Description

@joemasilotti

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions