feat(barcode-scanner): Add support for GS1 DataBar on iOS 15.4+ (#2437)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
Enkhjil Enkhbaatar
2025-07-01 23:40:22 +09:00
committed by GitHub
parent 6a8f255878
commit aa9140e1ac
5 changed files with 69 additions and 8 deletions
@@ -52,6 +52,15 @@ func discoverCaptureDevices() -> [AVCaptureDevice] {
}
func formatStringFromMetadata(_ type: AVMetadataObject.ObjectType) -> String {
if #available(iOS 15.4, *) {
if type == .gs1DataBar {
return "GS1_DATA_BAR"
} else if type == .gs1DataBarLimited {
return "GS1_DATA_BAR_LIMITED"
} else if type == .gs1DataBarExpanded {
return "GS1_DATA_BAR_EXPANDED"
}
}
switch type {
case AVMetadataObject.ObjectType.upce:
return "UPC_E"