react-native-ml-kit
react-native-ml-kit copied to clipboard
Add barcode raw value
trafficstars
What happened?
BarcodeScanning.m
[result addObject:@{
@"value": barcode.displayValue,
@"format": format,
@"rawValue": barcode.rawValue
}];
BarcodeScanningModule.java
public void onSuccess(List<Barcode> barcodes) {
WritableArray result = Arguments.createArray();
for (Barcode barcode : barcodes) {
WritableMap map = Arguments.createMap();
map.putString("value", barcode.getDisplayValue());
map.putDouble("format", barcode.getFormat());
map.putString("rawValue", barcode.getRawValue());
result.pushMap(map);
}
promise.resolve(result);
}
TS
export interface Barcode {
format: BarcodeFormat;
value: string;
rawValue: string;
}
Could you please add a getRawValue. Thanks
Version
@react-native-ml-kit/barcode-scanning: version@react-native-ml-kit/face-detection: version@react-native-ml-kit/identify-languages: version@react-native-ml-kit/image-labeling: version@react-native-ml-kit/text-recognition: version@react-native-ml-kit/translate-text: version
Which ML Kit packages do you use?
- [X] @react-native-ml-kit/barcode-scanning
- [ ] @react-native-ml-kit/face-detection
- [ ] @react-native-ml-kit/identify-languages
- [ ] @react-native-ml-kit/image-labeling
- [ ] @react-native-ml-kit/text-recognition
- [ ] @react-native-ml-kit/translate-text
What platforms are you seeing this issue on?
- [X] Android
- [X] iOS
System Information
Check prev message
Steps to Reproduce
Check prev message
Hello @Iuriy-Budnikov, thanks for reporting this issue and sorry that it took me that long to check it.
It seems like you already have a solution in mind which is great, can you please open a PR for it?