Skip to content

✨ Barcode returned as base64 in separate field #3711

@mvniekerk

Description

@mvniekerk

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ featureProposes a new feature or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions