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

bug: #49

Closed
4 of 7 tasks
CosmicDigital opened this issue Jun 21, 2023 · 3 comments
Closed
4 of 7 tasks

bug: #49

CosmicDigital opened this issue Jun 21, 2023 · 3 comments

Comments

@CosmicDigital
Copy link

Plugin(s)

  • Barcode Scanning
  • Translation

Did you test the latest version?

  • I use the latest version

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

const { barcodes } = await BarcodeScanner.scan({
formats: [BarcodeFormat.QrCode],
lensFacing: LensFacing.Front,
});

The lensFacing.Front is not being supported in Android, but this works on iOS.

Expected behavior

The LensFacing.Front works in iOS

Reproduction

https://github.com/capawesome-team/.capacitor-app

Steps to reproduce

  1. Install plugin on ionic
  2. Run the app on iOS, will scan with front cam by default
  3. Run the app on Android, will not run with front cam

Other information

No response

Capacitor doctor

Latest Dependencies:

@capacitor/cli: 5.0.5
@capacitor/core: 5.0.5
@capacitor/android: 5.0.5
@capacitor/ios: 5.0.5

Installed Dependencies:

@capacitor/cli: 5.0.4
@capacitor/core: 5.0.4
@capacitor/android: 5.0.4
@capacitor/ios: 5.0.4

[success] iOS looking great! 👌
[error] Missing attribute in app/src/main

Before submitting

  • I understand that incomplete issues (e.g. without reproduction) are closed.
@CosmicDigital CosmicDigital added bug/fix Something isn't working needs: triage labels Jun 21, 2023
@robingenz
Copy link
Member

What exactly is your issue? Is the front camera not working on Android or is it just not the default direction? Please update your problem with more information.

@CosmicDigital
Copy link
Author

Thank you @robingenz for the reply

even though I have set lensFacing: LensFacing.Front

the back camera always opens

@robingenz
Copy link
Member

The „scan(…)“ method currently officially only supports „formats“ as option and not „lensFacing“, see https://github.com/capawesome-team/capacitor-mlkit/tree/main/packages/barcode-scanning#scanoptions.
This is because it is not possible on Android with the SDK used. You should use the „startScan(…)“ method if you want to use the front camera.
We will also remove the undocumented iOS code.
For this reason I am closing this issue.

@robingenz robingenz closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants