What feature or enhancement are you suggesting?
There's a difference in behaviour between iOS and Android wrt binary barcodes (US and RSA driver's licenses) that are not UTF-8 text, but (encrypted) binary.
With iOS, the raw bytes are sent.
With Android, the current code tries to make a UTF-8 string from the bytes, as per https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#public-string-getrawvalue in this line:
|
code.putString("value", barcode.rawValue) |
Instead of doing https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#public-byte[]-getrawbytes .
My suggestion - have an extra field base64 on the Code, that has the raw base64 of the bytes.
What Platforms whould this feature/enhancement affect?
iOS, Android
Alternatives/Workarounds
I've forked the code, git@github.com:mvniekerk/react-native-vision-camera.git
For Code.value I'm returning byte64 rawbytes string.
This is a hack and causes platform dependent handling of the value.
Additional information
What feature or enhancement are you suggesting?
There's a difference in behaviour between iOS and Android wrt binary barcodes (US and RSA driver's licenses) that are not UTF-8 text, but (encrypted) binary.
With iOS, the raw bytes are sent.
With Android, the current code tries to make a UTF-8 string from the bytes, as per https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#public-string-getrawvalue in this line:
react-native-vision-camera/package/android/src/main/java/com/mrousavy/camera/react/CameraView+Events.kt
Line 145 in 0d7b939
Instead of doing https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/common/Barcode#public-byte[]-getrawbytes .
My suggestion - have an extra field base64 on the Code, that has the raw base64 of the bytes.
What Platforms whould this feature/enhancement affect?
iOS, Android
Alternatives/Workarounds
I've forked the code, git@github.com:mvniekerk/react-native-vision-camera.git
For Code.value I'm returning byte64 rawbytes string.
This is a hack and causes platform dependent handling of the value.
Additional information