From a546e2815a818a5ae785134ae84c552a2d31e931 Mon Sep 17 00:00:00 2001 From: Julia Finocchiaro Date: Thu, 6 Jun 2024 13:57:05 -0400 Subject: [PATCH] fix: support new lux HKUnit for iOS 17 --- ios/Serializers.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ios/Serializers.swift b/ios/Serializers.swift index 0064abfd..bcd8a9f8 100644 --- a/ios/Serializers.swift +++ b/ios/Serializers.swift @@ -107,6 +107,12 @@ func serializeUnknownQuantity(quantity: HKQuantity) -> [String: Any]? { } } + if #available(iOS 17.0, *) { + if quantity.is(compatibleWith: HKUnit.lux()) { + return serializeQuantity(unit: HKUnit.lux(), quantity: quantity) + } + } + if quantity.is(compatibleWith: SpeedUnit) { return serializeQuantity(unit: SpeedUnit, quantity: quantity) }