Back to all

iOS Barcode Scanner: Close dismisses camera but scan request never resolves

Hi Median team,
We are testing Median’s native Barcode Scanner plugin in an iOS app and have found a reproducible issue with scanner cancellation/dismissal.
Environment

  • iOS app bundle ID: co.median.ios.krlqmnq
  • Physical device: iPhone 11
  • Median/GoNativeCore: 3.0.14
  • BarcodeScanner: 5.0.1
  • BarcodeScannerPlugin: 1.4.0
  • Native iOS project generated from Median and built/run through Xcode
    Successful behaviour
    Barcode scanning itself works correctly. We have physically verified successful scans for:
  • EAN-13
  • EAN-8
  • UPC-A
  • UPC-E
    Successful scans return a result normally and the scanner can subsequently be opened again.
    Problem
    If the scanner is opened and the user taps the native Close button without scanning a barcode:
  1. The native scanner UI closes successfully.
  2. The app returns to the web view.
  3. However, the JavaScript/native scan request does not settle with a cancellation result.
  4. The web layer therefore continues to believe that a scan is in progress.
  5. A second scan cannot be started until we manually clear/reset our pending scanner state.
    We originally tested the Promise-style scanner integration and reproduced this consistently.
    We also tested the callback-style integration. One earlier test appeared to settle correctly, but a subsequent controlled retest on the current published build reproduced the same problem: the camera closed, but the callback/request remained pending and our app still required a manual reset.
    So at present, changing from Promise to callback transport does not appear to provide a reliable cancellation solution.
    Expected behaviour
    When the user taps the native Close/Cancel button, we would expect the scanner API to complete exactly once with a documented cancellation/dismissal result so that our web application can safely clear its pending state and allow another scan.
    Questions
    Could you please confirm:
  6. What is the officially supported cancellation/dismissal contract for median.barcode.scan() on iOS?
  7. Should tapping the native Close button resolve/reject the Promise or invoke the callback with a cancellation result?
  8. Is this a known issue in BarcodeScannerPlugin 1.4.0?
  9. Is there a newer plugin/core version that fixes native scanner dismissal?
  10. If not, is there a supported event, callback or native hook we can use to detect that the scanner has been dismissed and safely release the pending scan?
  11. In particular, could you confirm whether the plugin's native dismissal path / scannerDidDismiss is expected to propagate a cancellation result back through the Median JavaScript bridge?
    We can provide screenshots, a minimal reproduction sequence and further Xcode/native project information if useful.
    We are currently treating successful barcode scanning as working and isolating this specifically as a native scanner cancellation/dismissal issue.
    Thanks.