Support for hardware while using PWA

Hi all,

I would like to summarize what I’ve found about hardware access to PWA app.

  1. Camera
    It seems to be no problem accessing camera from app neither for Android nor iOS. There is a feature MediaDevices.getUserMedia() (MediaDevices.getUserMedia() - Web APIs | MDN) which is compatible with all major browsers. This method prompts the user for permission to use a media input which produces a MediaStream with tracks containing the requested types of media in our case it will be { video: true }. This feature can only be used in secure contexts.

  2. External hardware (barcode readers, barcode printers)
    There is possibility to connect devices with BLE (Bluetooth Low Energy) technology support. For that, using web bluetooth is needed, it is a project of the W3C Web Bluetooth Community Group, which allow websites to communicate with devices in a secure and privacy-preserving way.
    For React package is called react-web-bluetooth.

Any feedback will be appreciated:)

Best,
Magalena

Thanks @MagdalenaToczek . Did you happen to look for any barcode scanners that use bluetooth BLE and GATT? I’ve done some quick searches but haven’t found any. That appears to be OK, as most are designed to simulate keyboard entry, and some have features that make the onscreen w/ keyboard emulation cleaner to work with. In that case we can still have a use-case that works regardless of using web bluetooth. The more ideal future will likely be scanners, web standards, and code though that all works together and bypasses the keyboard emulation.

If I understands correctly GATT protocol is implemented in BLE technology, so we should look for barcode scanners with BLE or Bluetooth Smart support. Perhaps that models are suitable for you?