Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Issue with specific phones Samsung Ultra S21 and S22 #223

Closed
gentlyawesome opened this issue Apr 18, 2023 · 13 comments
Closed

Issue with specific phones Samsung Ultra S21 and S22 #223

gentlyawesome opened this issue Apr 18, 2023 · 13 comments

Comments

@gentlyawesome
Copy link

I have already deployed a sample apk that uses the barcode scanner. The plugin is already tested in Android and iOS but there are specific devices that do not trigger the QR Code Camera: Samsung Ultra S21 and S22. Is there an update needed?

@thegnuu
Copy link
Collaborator

thegnuu commented Apr 18, 2023

@gentlyawesome unfortunately I have no Samsung devices to test with, I have just mi iPhone 14 and Pixel 6 to test the plugin with.

@kumarjitendra-epic
Copy link

@gentlyawesome , can you please share the code for the barcode scanner that you have written. I tried using as specified but it doesn't scans the bar code, where QR code is scanned perfectly. Help would be really appreciated.

@thegnuu
Copy link
Collaborator

thegnuu commented May 8, 2023

@gentlyawesome you might be able to get better results with the new pre-release v5.0.0-beta.1.

Unfortunately I am still not able to test it with one of those devices, so I will close the issue for now.

@kumarjitendra-epic If you still have problems feel free to open a new issue.

@thegnuu thegnuu closed this as completed May 8, 2023
@JesusAlbornoz
Copy link

I think this issue needs to be reopened. I am also getting reports of not being able to scan QR on the Samsung S21 and Samsung S23.

@JanMisker
Copy link

I think this issue needs to be reopened. I am also getting reports of not being able to scan QR on the Samsung S21 and Samsung S23.

Did you test with the new 5.0 beta release?

@thegnuu thegnuu reopened this May 25, 2023
@thegnuu
Copy link
Collaborator

thegnuu commented May 25, 2023

As @JanMisker said, please test it with the beta release first, the camera-handling was updated in this release. If it still not works one of you guys who obviously owns a device that is not working will need to look at it and provide way more information.

The plugin is only tested on a Pixel device and on an iPhone 14. We cannot work with a simple "it does not work" obviously. It might as well be that this is some sort of Samsung bug, since it seems only to have issues on Samsung devices.

@Waterdhavian
Copy link

I have tested version 3, version 4 and the beta version 5 on 2 samsung android devices, both of them worked like 2 months ago. Nothing was changed in my app (as in version of this plugin or other packages) but the phones did receive an update from Samsung with updates. And last week i needed to test it again and it stopped working on both of my devices. Before version 3 worked. Now version 3, 4 and the beta 5 don't work. Pretty sure this is because of something that Samsung changed.

The plugin does not give an error in the console but the DOM element that holds the video feed is not created / not showing. We already had some contact about this @thegnuu about the beta version where it did give an error in Android Studio. I have checked but version 3 and 4 don't give me an error but also still not working.

Hoping someone in the community here with a Samsung can help resolve this, i am open to assist and help where i can.

@nvahalik
Copy link

nvahalik commented Jul 6, 2023

We have an issue similar to this... it's an S21.

We also use the https://github.com/capacitor-community/camera-preview module. When we navigate to a page that uses that module, it prompts for permission and then we can use the barcode scanner.

@nvahalik
Copy link

nvahalik commented Jul 6, 2023

Honestly, it almost looks like the code for handling the permissions check on Android is just... missing.

We seem to have gotten this working by changing this:

BarcodeScanner.checkPermission()
    .then((r) => {
      // scan all the things
    })

to this:

BarcodeScanner.checkPermission()
    .then((r) => {
      // Only continue if we have granted permissions.
      if (r.granted) {
        return r;
      }
      return BarcodeScanner.checkPermission({force: true});
    }).then(() => {

@gentlyawesome
Copy link
Author

@gentlyawesome you might be able to get better results with the new pre-release v5.0.0-beta.1.

Unfortunately I am still not able to test it with one of those devices, so I will close the issue for now.

@kumarjitendra-epic If you still have problems feel free to open a new issue.

I'll try this one out.

@gentlyawesome
Copy link
Author

Honestly, it almost looks like the code for handling the permissions check on Android is just... missing.

We seem to have gotten this working by changing this:

BarcodeScanner.checkPermission()
    .then((r) => {
      // scan all the things
    })

to this:

BarcodeScanner.checkPermission()
    .then((r) => {
      // Only continue if we have granted permissions.
      if (r.granted) {
        return r;
      }
      return BarcodeScanner.checkPermission({force: true});
    }).then(() => {

I tried to use this but still didn't work.

@gentlyawesome
Copy link
Author

We have an issue similar to this... it's an S21.

We also use the https://github.com/capacitor-community/camera-preview module. When we navigate to a page that uses that module, it prompts for permission and then we can use the barcode scanner.

Did this work on your end?

camera-preview will handle permission and then use barcode scanner plugin?

@gentlyawesome
Copy link
Author

@gentlyawesome you might be able to get better results with the new pre-release v5.0.0-beta.1.

Unfortunately I am still not able to test it with one of those devices, so I will close the issue for now.

@kumarjitendra-epic If you still have problems feel free to open a new issue.

I have used the latest https://github.com/capawesome-team/capacitor-mlkit/tree/main/packages/barcode-scanning

which was a branch and worked in the Samsung phones. Thank you. :)

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

No branches or pull requests

7 participants