Scan QR and Barcode

Hi, I have a question. Is there a library (the most used or the best…) that scans barcodes and QR codes on both Android and iOS?

The versions I have of the Ionic project are:

  • NodeJS: 12.21.0
  • Ionic CLI: 6.20.8
  • Ionic Framework: @ionic/angular 5.6.12
  • @angular/cli: 12.1.3
  • Capacitor CLI: 3.9.0

Thanks!

I know the following two Capacitor plugins for scanning barcodes and QR codes:

  1. Capacitor Community Barcode Scanner
  2. Capacitor ML Kit Barcode Scanning

The biggest difference between the two plugins is the SDK used to recognise the barcodes. The Capacitor Community Barcode Scanner plugin uses the ZXing decoder and the Capacitor ML Kit Barcode Scanning plugin uses the ML Kit from Google.
However, both supported only the current Capacitor version (4+).

Disclaimer: I am the maintainer of the second plugin.

Okay, thanks!

So, in my project with those versiones, will not work only because for Capacitor? Am I right?

Greetings.

Yes, you need to update your Capacitor version. However, you should also update your Capacitor version regardless of the plugin in order to comply with the current Play Store guidelines regarding the minimum SDK Targets (see Announcing Capacitor 4.0).

Hi Robin,

The ML Kit Barcode (maintained by you) works on Android 14, but it does not work on older devices (Android 11, 12, 13).

I followed the steps in Github. Am I missing something for older devices?

I cannot help you without any error message. Please create a GitHub issue with a minimal, reproducible example.

Just an update. Upon further Googling, I managed to find the solution.
This was the issue.

installGoogleBarcodeScannerModule

Solution provided here:

1 Like