Skip to content

Issue: DecodedData events (event ID 5) never fire in web app via CaptureJS — S370 only emits DeviceManagerArrival, no scan data reaches WebSocket #14

@ja13stud

Description

@ja13stud

Your Socket Mobile Developer ID

88ff8794-1218-f111-8341-6045bd03f534

Environment

  • Device: Socket Mobile SocketScan S370
  • Host Platform: Android (Samsung Galaxy tablet), Google Chrome
  • Companion App Version: 3.5.1 (28)
  • CaptureJS SDK: captureJs-latest.js loaded from https://socketimagescdn.azureedge.net/cdn/scripts/captureJs-latest.js
  • App Type: Web app (React, running in Chrome browser, served over HTTPS)
  • S370 Profile: Reader Only Profile (ROP) — confirmed in Reader Mode

Description

A CaptureJS-integrated web app successfully opens a Capture session and receives connection lifecycle events (ListenerStarted, DeviceManagerArrival, DeviceOwnership), but DecodedData events (event ID 5) never fire. A raw WebSocket tap on ws://127.0.0.1:18481 confirms that the Companion app sends zero messages to the socket when the S370 scans a barcode or NFC card. The Companion app's own built-in test screen reads scan data correctly (e.g. a driver's license barcode), confirming the scanner hardware and Companion app are functional.

Steps to Reproduce

  1. Pair the S370 to an Android tablet (via Android Bluetooth system settings)
  2. Open the Companion app — device appears connected
  3. Load a web app that initializes CaptureJS with a valid appId, developerId, and appKey
  4. Call capture.open(config) — connection succeeds, events fire: ID 9 (ListenerStarted), ID 11 (DeviceManagerArrival), ID 10 (DeviceOwnership)
  5. Event ID 1 (DeviceArrival) never fires
  6. Attempt to call openDevice(guid, parentCapture) using the GUID from DeviceManagerArrival — call resolves but returns {"result":{}} (empty object, no device handle)
    Scan a barcode or tap an NFC card with the S370
  7. No DecodedData event fires. A raw WebSocket tap on ws://127.0.0.1:18481 shows no messages at all transmitted from the Companion app during the scan

Expected Behavior

  • Event ID 1 (DeviceArrival) should fire when the S370 connects
  • openDevice() should return a valid device handle
  • Scanning a barcode or tapping an NFC card should cause the Companion app to send a message over the WebSocket, resulting in a DecodedData event (ID 5) in the app's onEventNotification callback

Actual Behavior

  • Only DeviceManagerArrival (ID 11) fires — DeviceArrival (ID 1) never fires
  • openDevice() resolves with {"result":{}} — empty result, no usable handle
  • Scanning produces no WebSocket traffic whatsoever — confirmed via raw ws.onmessage intercept
  • The Companion app's own test screen reads the same device successfully

Additional Context

  • The appId is in web:com.winstash.pos format per web app requirements
  • The developerId and appKey were issued via the Socket Mobile developer portal and are valid (connection events confirm the app is recognized)
  • All events from the Companion app (9, 11, 10) route correctly through the root Capture instance's onEventNotification — this was confirmed by reading the captureJs-latest.js source
  • The raw WebSocket tap was added specifically to rule out a CaptureJS routing or callback-wiring issue — the tap sits directly on the underlying WebSocket object and received zero frames during scanning
  • The Companion app's test scan (same device, same tablet, same session) produced full decoded data, which rules out hardware failure and Companion app malfunction
  • Question: Does the S370 need to be paired via a Socket Mobile app (e.g. Nice 2CU) rather than via Android's system Bluetooth settings in order for scan data to be routed through the Companion app to a CaptureJS web app? If so, the pairing procedure in the developer documentation for web apps should clarify this requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions