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

QR-Code scanner not working on Samsung with Android 14 #30

Open
HereIsNils opened this issue Oct 17, 2024 · 2 comments
Open

QR-Code scanner not working on Samsung with Android 14 #30

HereIsNils opened this issue Oct 17, 2024 · 2 comments

Comments

@HereIsNils
Copy link

Project:

Ionic/Angular: 8.3.2
Capacitor: 6.1.2
barcode-scanner: 1.0.1

Test devices:

Specs of the phone where the plugin is not working on:
One UI-Version: 6.0
Android: 14
Productname: Galaxy A53 5G

Other test devices, where the plugin is working on:
Iphone 11 Pro (IOS 18.0), Ipad Pro 4th generation (IOS 18.0.1), Xiaomi Redmi Note 9 (Android 12), Lenovo P11 (Android 13), Emulated Pixel 8 Fold (Android 14 & 15)

Issue:

We are trying to use this plugin and got it to work on IOS 18 and older android phones and some android 35 simulators, as listed above.
When scanning a qr code with a Samsung galaxy A53 5G, no result is returned. The qr code is not being recognized by the plugin and therefore the camera just stays open. We tried to scan the qr code many times, from different angles, different light conditions, but couldnt get the code to be scanned. With the normal camera app, the qr code is recoginzed instantly.
Code that opens the camera:

openScanner() {
    if (this.platform.is('capacitor')) {
      CapacitorBarcodeScanner.scanBarcode({
        hint: CapacitorBarcodeScannerTypeHint.QR_CODE,
        scanInstructions: TranslatePipe.get("ScanDevice"),
        scanText: TranslatePipe.get("ScanDevice")
      }).then(response => {
        let result = response.ScanResult.split(";");
        if (result.length > 1) {
          this.token = result[0];
          this.deviceID = result[1];
          setTimeout(() => {
            this.claimDevice();
          }, 100);
        } else {
          //TODO: Show Toast
        }
      });

We also tried it with the .ALL typeHint, but got no result either.
We also added android specific configuration:

    android: {
          scanningLibrary: CapacitorBarcodeScannerAndroidScanningLibrary.ZXING
        }

and tried both ZXING and mlkit, but with no result either.

Is there a known problem with samsung phones?

@cemkarahan84
Copy link

Take a look at my PR we got the same issue and found a fix for Android

The plugin try to get android configuration in an object called native but doesn't exist in the definition.

You have to fix the definition or modify the plugin itself.

@Geschan
Copy link

Geschan commented Jan 8, 2025

We have observed the same issue on Samsung devices with Android 14.

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

3 participants