Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QRScanner ScanResult.scanCanceled and ScanResult.scanError never triggered on iOS #3780

Open
Rocketeer007 opened this issue Jan 16, 2024 · 0 comments

Comments

@Rocketeer007
Copy link
Contributor

Describe the bug
Using the latest version of the QRScanner library (https://github.com/codenameone/QRScanner)

On iOS, when triggering a scan, the UI presents a "Cancel" button. Tapping this dismisses the scanning dialog, but does not invoke the ScanResult.scanCanceled method, so the calling code has no way to detect that the scan has been aborted with no result.

To Reproduce
Steps to reproduce the behaviour:

QRScanner.scanQRCode(new ScanResult() {
            @Override
            public void scanCompleted(String contents, String formatName, byte[] rawBytes) {Log.p("Scan completed: " + contents + " / " + formatName);}

            @Override
            public void scanCanceled() {Log.p("Scan canceled");}

            @Override
            public void scanError(int errorCode, String message) {Log.p("Scan error: " + errorCode + " / " + message);}
        });

Implement a trivial scan handler as above, and deploy it on iOS

Expected behavior

  • When the Cancel button is tapped, the "Scan canceled" message should be logged
  • (Ideally) If the user has denied access to the Camera, the "Scan error" message should be logged

Additional context
Checking the source, it does not appear that either scanCanceledCallback nor scanErrorCallback are ever called from iOS code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant