Closed nthchild1 closed 9 months ago
Yes, it would be nice if the lib supported upc-a especially since BarcodeScannerOptions
supports it.
Same, I also need ability to scan upc_a, coming from vision-camera-code-scanner
which was deprecated in favour of v3
Same issue. Seems clunky to need to remove the leading 0 in iOS.
I managed to get this working by modifying the android files to include upc-a and running patch-package. iOS already has the ability to scan upc-a because of ean-13, I just do a check to include the extra digit.
@Gambitboy can you share your patch file please?
@marcshilling Here is the patch file. Its quite a big. Not sure why, as it wasn't a lot of changes.
I still have a type issue for upc-a
which I haven't resolved yet.
https://gist.github.com/Gambitboy/0a2afa2485fd7c285a52b093de1c32b2
I have a similar issue. On android it can scan multiple barcodes and returns an array with all the barcodes scanned but on ios it returns only one item inside the array.
On iOS I use the native QR scanner from Apple, on Android I use Google's MLKit model. If there are differences, there's nothing I can do.
You can instead write a custom Frame Processor Plugin to use the same libs on both devices, or something like ZXing.
Hi ! MLKit actually provides support for upc-a ! "The following formats are supported: [...] UPC-A (FORMAT_UPC_A)". Sorry for tagging you @mrousavy, but do you consider in supporting it in your lib ? Thanks a lot !!
Hey @Couzix - Apple's Vision library doesn't support UPC-A though, so it would not be a cross-platform feature, which I like to avoid.
When I read through the apple docs it said it indirectly supported upc-a through ean. So once I added the missing code for android both devices types were able to scan a upc-a code.
Oh, interesting. Well I guess I could add those types and just mark them as @platform Android
then..
I'll quickly try to find the docs mentioning it, also since its working on my project. I don't mind doing a pull request. The only bit I never got to finish was type checking the UPC-A
for android
What's happening?
I am trying to scan
upc-a
(12 digit) codes which are not directly supported by this library. However, this library does supportean-13
which is a superset standard with an extra digit (13 digit). You can convert anyupc-a
code to anean-13
code by just adding a zero to the beginning of the string.The problem is that, when scanning an
upc-a
code with theean-13
codeType
enabled, the scanner returns a 13 digit ean-13 code as expected for iOS (it is adding an extra zero to the start of the string). It seems that in Android it is not adding a zero to the start of the string and is returning the original 12 digit code, resulting string is different for each platform.For example:
Scanning the following code:
returns
050000463916
in Android and0050000463916
in iOSReproduceable Code
Relevant log output
Camera Device
Device
Any iOS or Android smartphone
VisionCamera Version
3.3.1
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information