QR's CodeScanner returns "null" in prop "value" with some QR codes without any reason
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/react/CameraView+Events.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/react/CameraView+Events.kt
index aacb5c7..dd29af5 100644
--- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/react/CameraView+Events.kt
+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/react/CameraView+Events.kt
@@ -131,7 +131,7 @@ fun CameraView.invokeOnCodeScanned(barcodes: List<Barcode>, scannerFrame: CodeSc
val code = Arguments.createMap()
val type = CodeType.fromBarcodeType(barcode.format)
code.putString("type", type.unionValue)
- code.putString("value", barcode.rawValue)
+ code.putString("value", barcode.rawValue ?: barcode.displayValue ?: null)
barcode.boundingBox?.let { rect ->
val frame = Arguments.createMap()
This issue body was partially generated by patch-package.
Guten Tag, Hans here.
[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by
@mrousavyin his free time. To support@mrousavy, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.
Yes, this issue is still relevant. Would be good if this was the default behavior. I proposed it last year, but received no response unfortunately.
https://github.com/mrousavy/react-native-vision-camera/issues/2128#issuecomment-2129429930