Redth / ZXing.Net.Maui

Barcode Scanning for MAUI?
MIT License
477 stars 151 forks source link

Move BarcodeFormat define from ZXing.Net.Maui to seperated Nuget library #99

Open evolcano opened 1 year ago

evolcano commented 1 year ago

BarcodeFormat is defined in ZXing.Net.Maui, which cann't be refrenced by library. I can not use enum BarcodeFormat in Net library.

In Xamarin Version, BarcodeFormat is defined in ZXing.Net.Mobile, and could be referenced by Net library.

Please move the common define (such as BarcodeFormat , BarcodeResult, etc.) to a seperated Nuget package and has no releation to MAUI.

Ghostbird commented 1 year ago

I understand the desire for shareable code base for these kinds of things, but I don't think it's a good idea to share the logic from a MAUI only library with your further architecture.

I'd write a shared definition file, and a mapping for this library. That way you completely decouple from ZXing. For example, I have a MAUI app that uses ZXing and the camera as barcode scanner as the default fallback. However, if you install the app on a Datalogic Android device it will integrated with the device provided hardware for barcode scanning. Those have completely different definitions, so a shared overarching definition with mappings to different implementations/libraries makes sense.