@kingstinct/react-native-healthkit 13.4.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReactNativeHealthkit.podspec +1 -0
- package/app.plugin.ts +40 -2
- package/ios/BackgroundDeliveryManager.swift +196 -0
- package/ios/CategoryTypeModule.swift +1 -1
- package/ios/CoreModule.swift +24 -0
- package/ios/CorrelationTypeModule.swift +2 -35
- package/ios/ElectrocardiogramModule.swift +2 -34
- package/ios/HeartbeatSeriesModule.swift +2 -34
- package/ios/MedicationModule.swift +3 -35
- package/ios/PredicateHelpers.swift +2 -2
- package/ios/QuantityTypeModule.swift +11 -11
- package/ios/Serializers.swift +58 -90
- package/ios/StateOfMindModule.swift +2 -34
- package/ios/WorkoutProxy.swift +3 -149
- package/ios/generated/HealthkitGenerated.swift +52 -0
- package/lib/commonjs/generated/healthkit.generated.js +745 -0
- package/lib/commonjs/healthkit.ios.js +51 -17
- package/lib/commonjs/healthkit.js +120 -34
- package/lib/commonjs/specs/QuantityTypeModule.nitro.js +1 -0
- package/lib/commonjs/type-tests/generated-typing.js +2 -0
- package/lib/commonjs/types/CategoryType.js +19 -99
- package/lib/commonjs/types/Medication.js +2 -0
- package/lib/commonjs/types/MetadataEnums.js +17 -0
- package/lib/commonjs/types/QuantityType.js +4 -15
- package/lib/commonjs/types/WeatherCondition.js +2 -32
- package/lib/commonjs/types/Workouts.js +3 -98
- package/lib/commonjs/types/index.js +2 -0
- package/lib/module/generated/healthkit.generated.js +742 -0
- package/lib/module/healthkit.ios.js +49 -15
- package/lib/module/healthkit.js +94 -20
- package/lib/module/specs/QuantityTypeModule.nitro.js +1 -0
- package/lib/module/type-tests/generated-typing.js +1 -0
- package/lib/module/types/CategoryType.js +2 -98
- package/lib/module/types/Medication.js +1 -0
- package/lib/module/types/MetadataEnums.js +1 -0
- package/lib/module/types/QuantityType.js +2 -14
- package/lib/module/types/WeatherCondition.js +1 -32
- package/lib/module/types/Workouts.js +2 -98
- package/lib/module/types/index.js +2 -0
- package/lib/typescript/generated/healthkit.generated.d.ts +1006 -0
- package/lib/typescript/healthkit.d.ts +39 -36
- package/lib/typescript/healthkit.ios.d.ts +64 -53
- package/lib/typescript/hooks/useMostRecentQuantitySample.d.ts +3 -2
- package/lib/typescript/hooks/useMostRecentWorkout.d.ts +2 -2
- package/lib/typescript/hooks/useQuantitySampleById.d.ts +5 -4
- package/lib/typescript/hooks/useStatisticsForQuantity.d.ts +2 -2
- package/lib/typescript/hooks/useSubscribeToQuantitySamples.d.ts +1 -1
- package/lib/typescript/modules.d.ts +2 -2
- package/lib/typescript/specs/CategoryTypeModule.nitro.d.ts +3 -3
- package/lib/typescript/specs/CoreModule.nitro.d.ts +15 -0
- package/lib/typescript/specs/QuantityTypeModule.nitro.d.ts +20 -9
- package/lib/typescript/type-tests/generated-typing.d.ts +1 -0
- package/lib/typescript/types/CategoryType.d.ts +10 -104
- package/lib/typescript/types/CategoryTypeIdentifier.d.ts +1 -61
- package/lib/typescript/types/CorrelationType.d.ts +8 -2
- package/lib/typescript/types/ElectrocardiogramSample.d.ts +8 -1
- package/lib/typescript/types/HeartbeatSeries.d.ts +8 -1
- package/lib/typescript/types/InterfaceVerification.d.ts +14 -1
- package/lib/typescript/types/Medication.d.ts +10 -0
- package/lib/typescript/types/MetadataEnums.d.ts +1 -0
- package/lib/typescript/types/QuantitySample.d.ts +9 -1
- package/lib/typescript/types/QuantityType.d.ts +14 -18
- package/lib/typescript/types/QuantityTypeIdentifier.d.ts +1 -671
- package/lib/typescript/types/QueryOptions.d.ts +8 -4
- package/lib/typescript/types/Shared.d.ts +12 -41
- package/lib/typescript/types/StateOfMind.d.ts +8 -1
- package/lib/typescript/types/Subscriptions.d.ts +11 -11
- package/lib/typescript/types/WeatherCondition.d.ts +1 -30
- package/lib/typescript/types/Workouts.d.ts +18 -104
- package/lib/typescript/types/index.d.ts +2 -0
- package/lib/typescript/utils/getMostRecentQuantitySample.d.ts +2 -1
- package/lib/typescript/utils/getMostRecentWorkout.d.ts +2 -1
- package/lib/typescript/utils/getPreferredUnit.d.ts +2 -1
- package/lib/typescript/utils/getQuantitySampleById.d.ts +2 -1
- package/lib/typescript/utils/subscribeToQuantitySamples.d.ts +1 -1
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Bridge.hpp +55 -109
- package/nitrogen/generated/ios/ReactNativeHealthkit-Swift-Cxx-Umbrella.hpp +12 -18
- package/nitrogen/generated/ios/c++/HybridCategoryTypeModuleSpecSwift.hpp +5 -14
- package/nitrogen/generated/ios/c++/HybridCoreModuleSpecSwift.hpp +18 -2
- package/nitrogen/generated/ios/c++/HybridCorrelationTypeModuleSpecSwift.hpp +1 -13
- package/nitrogen/generated/ios/c++/HybridElectrocardiogramModuleSpecSwift.hpp +1 -13
- package/nitrogen/generated/ios/c++/HybridHeartbeatSeriesModuleSpecSwift.hpp +2 -14
- package/nitrogen/generated/ios/c++/HybridMedicationModuleSpecSwift.hpp +1 -13
- package/nitrogen/generated/ios/c++/HybridQuantityTypeModuleSpecSwift.hpp +19 -28
- package/nitrogen/generated/ios/c++/HybridStateOfMindModuleSpecSwift.hpp +2 -14
- package/nitrogen/generated/ios/c++/HybridWorkoutProxySpecSwift.hpp +2 -115
- package/nitrogen/generated/ios/swift/CategorySample.swift +4 -329
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifier.swift +112 -108
- package/nitrogen/generated/ios/swift/CategoryTypeIdentifierWriteable.swift +292 -0
- package/nitrogen/generated/ios/swift/CorrelationSample.swift +4 -347
- package/nitrogen/generated/ios/swift/ElectrocardiogramSample.swift +4 -329
- package/nitrogen/generated/ios/swift/FilterForWorkouts.swift +30 -30
- package/nitrogen/generated/ios/swift/FilterForWorkoutsBase.swift +30 -30
- package/nitrogen/generated/ios/swift/GeneralForm.swift +4 -4
- package/nitrogen/generated/ios/swift/HeartbeatSeriesSample.swift +4 -329
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCategoryTypeModuleSpec_cxx.swift +1 -1
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridCoreModuleSpec_cxx.swift +38 -0
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec.swift +6 -6
- package/nitrogen/generated/ios/swift/HybridQuantityTypeModuleSpec_cxx.swift +6 -6
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec.swift +1 -27
- package/nitrogen/generated/ios/swift/HybridWorkoutProxySpec_cxx.swift +2 -340
- package/nitrogen/generated/ios/swift/MedicationDoseEvent.swift +4 -329
- package/nitrogen/generated/ios/swift/ObjectTypeIdentifier.swift +492 -492
- package/nitrogen/generated/ios/swift/QuantitySample.swift +4 -329
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifier.swift +380 -384
- package/nitrogen/generated/ios/swift/QuantityTypeIdentifierWriteable.swift +372 -376
- package/nitrogen/generated/ios/swift/{QueryOptionsWithAnchorAndUnit.swift → QueryOptionsWithAnchorAndStringUnit.swift} +5 -5
- package/nitrogen/generated/ios/swift/{QueryOptionsWithSortOrderAndUnit.swift → QueryOptionsWithSortOrderAndStringUnit.swift} +5 -5
- package/nitrogen/generated/ios/swift/QueryStatisticsResponseFromSingleSource.swift +37 -37
- package/nitrogen/generated/ios/swift/SampleTypeIdentifier.swift +492 -492
- package/nitrogen/generated/ios/swift/SampleTypeIdentifierWriteable.swift +482 -486
- package/nitrogen/generated/ios/swift/StateOfMindSample.swift +4 -329
- package/nitrogen/generated/ios/swift/{StatisticsQueryOptions.swift → StatisticsQueryOptionsWithStringUnit.swift} +5 -5
- package/nitrogen/generated/ios/swift/WorkoutSample.swift +4 -402
- package/nitrogen/generated/shared/c++/CategorySample.hpp +8 -100
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifier.hpp +153 -149
- package/nitrogen/generated/shared/c++/CategoryTypeIdentifierWriteable.hpp +328 -0
- package/nitrogen/generated/shared/c++/CorrelationSample.hpp +9 -105
- package/nitrogen/generated/shared/c++/ElectrocardiogramSample.hpp +7 -99
- package/nitrogen/generated/shared/c++/FilterForWorkouts.hpp +13 -13
- package/nitrogen/generated/shared/c++/FilterForWorkoutsBase.hpp +13 -13
- package/nitrogen/generated/shared/c++/GeneralForm.hpp +7 -7
- package/nitrogen/generated/shared/c++/HeartbeatSeriesSample.hpp +8 -100
- package/nitrogen/generated/shared/c++/HybridCategoryTypeModuleSpec.hpp +5 -2
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridCoreModuleSpec.hpp +4 -2
- package/nitrogen/generated/shared/c++/HybridQuantityTypeModuleSpec.hpp +15 -15
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.cpp +1 -27
- package/nitrogen/generated/shared/c++/HybridWorkoutProxySpec.hpp +2 -37
- package/nitrogen/generated/shared/c++/MedicationDoseEvent.hpp +7 -99
- package/nitrogen/generated/shared/c++/ObjectTypeIdentifier.hpp +565 -565
- package/nitrogen/generated/shared/c++/QuantitySample.hpp +8 -100
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifier.hpp +407 -411
- package/nitrogen/generated/shared/c++/QuantityTypeIdentifierWriteable.hpp +398 -402
- package/nitrogen/generated/shared/c++/{QueryOptionsWithAnchorAndUnit.hpp → QueryOptionsWithAnchorAndStringUnit.hpp} +11 -11
- package/nitrogen/generated/shared/c++/{QueryOptionsWithSortOrderAndUnit.hpp → QueryOptionsWithSortOrderAndStringUnit.hpp} +11 -11
- package/nitrogen/generated/shared/c++/QueryStatisticsResponseFromSingleSource.hpp +12 -12
- package/nitrogen/generated/shared/c++/SampleTypeIdentifier.hpp +559 -559
- package/nitrogen/generated/shared/c++/SampleTypeIdentifierWriteable.hpp +541 -545
- package/nitrogen/generated/shared/c++/StateOfMindSample.hpp +8 -100
- package/nitrogen/generated/shared/c++/{StatisticsQueryOptions.hpp → StatisticsQueryOptionsWithStringUnit.hpp} +11 -11
- package/nitrogen/generated/shared/c++/WorkoutSample.hpp +7 -120
- package/package.json +5 -2
- package/src/generated/healthkit-schema.json +3680 -0
- package/src/generated/healthkit.generated.ts +1307 -0
- package/src/healthkit.ios.ts +225 -19
- package/src/healthkit.ts +181 -55
- package/src/hooks/useMostRecentQuantitySample.ts +6 -5
- package/src/hooks/useMostRecentWorkout.ts +2 -2
- package/src/hooks/useQuantitySampleById.ts +6 -5
- package/src/hooks/useStatisticsForQuantity.ts +2 -1
- package/src/hooks/useSubscribeToQuantitySamples.ts +1 -1
- package/src/modules.ts +7 -2
- package/src/specs/CategoryTypeModule.nitro.ts +8 -5
- package/src/specs/CoreModule.nitro.ts +20 -0
- package/src/specs/QuantityTypeModule.nitro.ts +81 -7
- package/src/test-setup.ts +2 -0
- package/src/type-tests/generated-typing.ts +133 -0
- package/src/types/CategoryType.ts +52 -148
- package/src/types/CategoryTypeIdentifier.ts +5 -134
- package/src/types/CorrelationType.ts +13 -3
- package/src/types/ElectrocardiogramSample.ts +13 -1
- package/src/types/HeartbeatSeries.ts +13 -1
- package/src/types/InterfaceVerification.ts +38 -1
- package/src/types/Medication.ts +19 -0
- package/src/types/MetadataEnums.ts +15 -0
- package/src/types/QuantitySample.ts +14 -2
- package/src/types/QuantityType.ts +22 -122
- package/src/types/QuantityTypeIdentifier.ts +5 -772
- package/src/types/QueryOptions.ts +11 -4
- package/src/types/Shared.ts +22 -49
- package/src/types/StateOfMind.ts +13 -1
- package/src/types/Subscriptions.ts +19 -13
- package/src/types/WeatherCondition.ts +1 -31
- package/src/types/Workouts.ts +44 -108
- package/src/types/index.ts +2 -0
- package/src/utils/getMostRecentQuantitySample.ts +4 -3
- package/src/utils/getMostRecentWorkout.ts +5 -2
- package/src/utils/getPreferredUnit.ts +5 -4
- package/src/utils/getQuantitySampleById.ts +4 -3
- package/src/utils/subscribeToQuantitySamples.ts +5 -3
- package/nitrogen/generated/ios/swift/HeartRateMotionContext.swift +0 -44
- package/nitrogen/generated/ios/swift/InsulinDeliveryReason.swift +0 -40
- package/nitrogen/generated/ios/swift/WeatherCondition.swift +0 -144
- package/nitrogen/generated/shared/c++/HeartRateMotionContext.hpp +0 -67
- package/nitrogen/generated/shared/c++/InsulinDeliveryReason.hpp +0 -62
- package/nitrogen/generated/shared/c++/WeatherCondition.hpp +0 -88
package/ios/Serializers.swift
CHANGED
|
@@ -9,6 +9,12 @@ import Foundation
|
|
|
9
9
|
import HealthKit
|
|
10
10
|
import NitroModules
|
|
11
11
|
|
|
12
|
+
private let metadataDateFormatter: ISO8601DateFormatter = {
|
|
13
|
+
let formatter = ISO8601DateFormatter()
|
|
14
|
+
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
|
15
|
+
return formatter
|
|
16
|
+
}()
|
|
17
|
+
|
|
12
18
|
func serializeQuantityTyped(unit: HKUnit, quantityNullable: HKQuantity?) -> Quantity? {
|
|
13
19
|
guard let q = quantityNullable else {
|
|
14
20
|
return nil
|
|
@@ -20,28 +26,6 @@ func serializeQuantityTyped(unit: HKUnit, quantityNullable: HKQuantity?) -> Quan
|
|
|
20
26
|
)
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
func serializeWeatherCondition(_ hkWeatherCondition: HKWeatherCondition?) -> WeatherCondition? {
|
|
24
|
-
guard let hkWeatherCondition = hkWeatherCondition else {
|
|
25
|
-
return nil
|
|
26
|
-
}
|
|
27
|
-
return WeatherCondition(rawValue: Int32(hkWeatherCondition.rawValue))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
func serializeInsulinDeliveryReason(_ hkReason: HKInsulinDeliveryReason?) -> InsulinDeliveryReason? {
|
|
31
|
-
guard let hkReason = hkReason else {
|
|
32
|
-
return nil
|
|
33
|
-
}
|
|
34
|
-
return InsulinDeliveryReason(rawValue: Int32(hkReason.rawValue))
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
func serializeHeartRateMotionContext(_ hkContext: HKHeartRateMotionContext?)
|
|
38
|
-
-> HeartRateMotionContext? {
|
|
39
|
-
guard let hkContext = hkContext else {
|
|
40
|
-
return nil
|
|
41
|
-
}
|
|
42
|
-
return HeartRateMotionContext(rawValue: Int32(hkContext.rawValue))
|
|
43
|
-
}
|
|
44
|
-
|
|
45
29
|
func serializeQuantityTyped(unit: HKUnit, quantity: HKQuantity) -> Quantity {
|
|
46
30
|
return Quantity(
|
|
47
31
|
unit: unit.unitString,
|
|
@@ -59,42 +43,10 @@ func serializeQuantitySample(sample: HKQuantitySample, unit: HKUnit) throws -> Q
|
|
|
59
43
|
startDate: sample.startDate,
|
|
60
44
|
endDate: sample.endDate,
|
|
61
45
|
hasUndeterminedDuration: sample.hasUndeterminedDuration,
|
|
62
|
-
|
|
63
|
-
metadataWeatherCondition: serializeWeatherCondition(
|
|
64
|
-
sample.metadata?[HKMetadataKeyWeatherCondition] as? HKWeatherCondition),
|
|
65
|
-
metadataWeatherHumidity: serializeUnknownQuantityTyped(
|
|
66
|
-
quantity: sample.metadata?[HKMetadataKeyWeatherHumidity] as? HKQuantity),
|
|
67
|
-
metadataWeatherTemperature: serializeUnknownQuantityTyped(
|
|
68
|
-
quantity: sample.metadata?[HKMetadataKeyWeatherTemperature] as? HKQuantity),
|
|
69
|
-
metadataInsulinDeliveryReason: serializeInsulinDeliveryReason(
|
|
70
|
-
sample.metadata?[HKMetadataKeyInsulinDeliveryReason] as? HKInsulinDeliveryReason),
|
|
71
|
-
metadataHeartRateMotionContext: serializeHeartRateMotionContext(
|
|
72
|
-
sample.metadata?[HKMetadataKeyHeartRateMotionContext] as? HKHeartRateMotionContext),
|
|
73
|
-
|
|
46
|
+
metadata: serializeMetadata(sample.metadata),
|
|
74
47
|
uuid: sample.uuid.uuidString,
|
|
75
48
|
sourceRevision: serializeSourceRevision(sample.sourceRevision),
|
|
76
|
-
device: serializeDevice(hkDevice: sample.device)
|
|
77
|
-
metadata: serializeMetadata(sample.metadata),
|
|
78
|
-
|
|
79
|
-
metadataExternalUUID: sample.metadata?[HKMetadataKeyExternalUUID] as? String,
|
|
80
|
-
metadataTimeZone: sample.metadata?[HKMetadataKeyTimeZone] as? String,
|
|
81
|
-
metadataWasUserEntered: sample.metadata?[HKMetadataKeyWasUserEntered] as? Bool,
|
|
82
|
-
metadataDeviceSerialNumber: sample.metadata?[HKMetadataKeyDeviceSerialNumber] as? String,
|
|
83
|
-
metadataUdiDeviceIdentifier: sample.metadata?[HKMetadataKeyUDIDeviceIdentifier] as? String,
|
|
84
|
-
metadataUdiProductionIdentifier: sample.metadata?[HKMetadataKeyUDIProductionIdentifier]
|
|
85
|
-
as? String,
|
|
86
|
-
metadataDigitalSignature: sample.metadata?[HKMetadataKeyDigitalSignature] as? String,
|
|
87
|
-
metadataDeviceName: sample.metadata?[HKMetadataKeyDeviceName] as? String,
|
|
88
|
-
metadataDeviceManufacturerName: sample.metadata?[HKMetadataKeyDeviceManufacturerName]
|
|
89
|
-
as? String,
|
|
90
|
-
metadataSyncIdentifier: sample.metadata?[HKMetadataKeySyncIdentifier] as? String,
|
|
91
|
-
metadataSyncVersion: sample.metadata?[HKMetadataKeySyncVersion] as? Double,
|
|
92
|
-
metadataWasTakenInLab: sample.metadata?[HKMetadataKeyWasTakenInLab] as? Bool,
|
|
93
|
-
metadataReferenceRangeLowerLimit: sample.metadata?[HKMetadataKeyReferenceRangeLowerLimit]
|
|
94
|
-
as? Double,
|
|
95
|
-
metadataReferenceRangeUpperLimit: sample.metadata?[HKMetadataKeyReferenceRangeUpperLimit]
|
|
96
|
-
as? Double,
|
|
97
|
-
metadataAlgorithmVersion: sample.metadata?[HKMetadataKeyAlgorithmVersion] as? Double
|
|
49
|
+
device: serializeDevice(hkDevice: sample.device)
|
|
98
50
|
)
|
|
99
51
|
}
|
|
100
52
|
throw runtimeErrorWithPrefix(
|
|
@@ -116,42 +68,10 @@ func serializeCategorySample(sample: HKCategorySample) -> CategorySample {
|
|
|
116
68
|
startDate: sample.startDate,
|
|
117
69
|
endDate: sample.endDate,
|
|
118
70
|
hasUndeterminedDuration: sample.hasUndeterminedDuration,
|
|
119
|
-
|
|
120
|
-
metadataWeatherCondition: serializeWeatherCondition(
|
|
121
|
-
sample.metadata?[HKMetadataKeyWeatherCondition] as? HKWeatherCondition),
|
|
122
|
-
metadataWeatherHumidity: serializeUnknownQuantityTyped(
|
|
123
|
-
quantity: sample.metadata?[HKMetadataKeyWeatherHumidity] as? HKQuantity),
|
|
124
|
-
metadataWeatherTemperature: serializeUnknownQuantityTyped(
|
|
125
|
-
quantity: sample.metadata?[HKMetadataKeyWeatherTemperature] as? HKQuantity),
|
|
126
|
-
metadataInsulinDeliveryReason: serializeInsulinDeliveryReason(
|
|
127
|
-
sample.metadata?[HKMetadataKeyInsulinDeliveryReason] as? HKInsulinDeliveryReason),
|
|
128
|
-
metadataHeartRateMotionContext: serializeHeartRateMotionContext(
|
|
129
|
-
sample.metadata?[HKMetadataKeyHeartRateMotionContext] as? HKHeartRateMotionContext),
|
|
130
|
-
|
|
71
|
+
metadata: serializeMetadata(sample.metadata),
|
|
131
72
|
uuid: sample.uuid.uuidString,
|
|
132
73
|
sourceRevision: serializeSourceRevision(sample.sourceRevision),
|
|
133
|
-
device: serializeDevice(hkDevice: sample.device)
|
|
134
|
-
metadata: serializeMetadata(sample.metadata),
|
|
135
|
-
|
|
136
|
-
metadataExternalUUID: sample.metadata?[HKMetadataKeyExternalUUID] as? String,
|
|
137
|
-
metadataTimeZone: sample.metadata?[HKMetadataKeyTimeZone] as? String,
|
|
138
|
-
metadataWasUserEntered: sample.metadata?[HKMetadataKeyWasUserEntered] as? Bool,
|
|
139
|
-
metadataDeviceSerialNumber: sample.metadata?[HKMetadataKeyDeviceSerialNumber] as? String,
|
|
140
|
-
metadataUdiDeviceIdentifier: sample.metadata?[HKMetadataKeyUDIDeviceIdentifier] as? String,
|
|
141
|
-
metadataUdiProductionIdentifier: sample.metadata?[HKMetadataKeyUDIProductionIdentifier]
|
|
142
|
-
as? String,
|
|
143
|
-
metadataDigitalSignature: sample.metadata?[HKMetadataKeyDigitalSignature] as? String,
|
|
144
|
-
metadataDeviceName: sample.metadata?[HKMetadataKeyDeviceName] as? String,
|
|
145
|
-
metadataDeviceManufacturerName: sample.metadata?[HKMetadataKeyDeviceManufacturerName]
|
|
146
|
-
as? String,
|
|
147
|
-
metadataSyncIdentifier: sample.metadata?[HKMetadataKeySyncIdentifier] as? String,
|
|
148
|
-
metadataSyncVersion: sample.metadata?[HKMetadataKeySyncVersion] as? Double,
|
|
149
|
-
metadataWasTakenInLab: sample.metadata?[HKMetadataKeyWasTakenInLab] as? Bool,
|
|
150
|
-
metadataReferenceRangeLowerLimit: sample.metadata?[HKMetadataKeyReferenceRangeLowerLimit]
|
|
151
|
-
as? Double,
|
|
152
|
-
metadataReferenceRangeUpperLimit: sample.metadata?[HKMetadataKeyReferenceRangeUpperLimit]
|
|
153
|
-
as? Double,
|
|
154
|
-
metadataAlgorithmVersion: sample.metadata?[HKMetadataKeyAlgorithmVersion] as? Double
|
|
74
|
+
device: serializeDevice(hkDevice: sample.device)
|
|
155
75
|
)
|
|
156
76
|
}
|
|
157
77
|
|
|
@@ -182,6 +102,16 @@ func serializeUnknownQuantityTyped(quantity: HKQuantity?) -> Quantity? {
|
|
|
182
102
|
return serializeQuantityTyped(unit: HKUnit.count(), quantity: quantity)
|
|
183
103
|
}
|
|
184
104
|
|
|
105
|
+
let countPerMinuteUnit = HKUnit(from: "count/min")
|
|
106
|
+
if quantity.is(compatibleWith: countPerMinuteUnit) {
|
|
107
|
+
return serializeQuantityTyped(unit: countPerMinuteUnit, quantity: quantity)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let countPerSecondUnit = HKUnit(from: "count/s")
|
|
111
|
+
if quantity.is(compatibleWith: countPerSecondUnit) {
|
|
112
|
+
return serializeQuantityTyped(unit: countPerSecondUnit, quantity: quantity)
|
|
113
|
+
}
|
|
114
|
+
|
|
185
115
|
if quantity.is(compatibleWith: HKUnit.meter()) {
|
|
186
116
|
return serializeQuantityTyped(unit: HKUnit.meter(), quantity: quantity)
|
|
187
117
|
}
|
|
@@ -210,6 +140,14 @@ func serializeUnknownQuantityTyped(quantity: HKQuantity?) -> Quantity? {
|
|
|
210
140
|
return serializeQuantityTyped(unit: HKUnit.hertz(), quantity: quantity)
|
|
211
141
|
}
|
|
212
142
|
|
|
143
|
+
let decibelAWeightedSoundPressureLevelUnit = HKUnit(from: "dBASPL")
|
|
144
|
+
if quantity.is(compatibleWith: decibelAWeightedSoundPressureLevelUnit) {
|
|
145
|
+
return serializeQuantityTyped(
|
|
146
|
+
unit: decibelAWeightedSoundPressureLevelUnit,
|
|
147
|
+
quantity: quantity
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
213
151
|
if quantity.is(compatibleWith: SpeedUnit) {
|
|
214
152
|
return serializeQuantityTyped(unit: SpeedUnit, quantity: quantity)
|
|
215
153
|
}
|
|
@@ -218,6 +156,11 @@ func serializeUnknownQuantityTyped(quantity: HKQuantity?) -> Quantity? {
|
|
|
218
156
|
return serializeQuantityTyped(unit: METUnit, quantity: quantity)
|
|
219
157
|
}
|
|
220
158
|
|
|
159
|
+
let vo2MaxUnit = HKUnit(from: "ml/(kg*min)")
|
|
160
|
+
if quantity.is(compatibleWith: vo2MaxUnit) {
|
|
161
|
+
return serializeQuantityTyped(unit: vo2MaxUnit, quantity: quantity)
|
|
162
|
+
}
|
|
163
|
+
|
|
221
164
|
if quantity.is(compatibleWith: HKUnit.internationalUnit()) {
|
|
222
165
|
return serializeQuantityTyped(unit: HKUnit.internationalUnit(), quantity: quantity)
|
|
223
166
|
}
|
|
@@ -271,22 +214,47 @@ func serializeMetadata(_ metadata: [String: Any]?) -> AnyMap {
|
|
|
271
214
|
let serialized = AnyMap()
|
|
272
215
|
if let m = metadata {
|
|
273
216
|
for item in m {
|
|
217
|
+
if let number = item.value as? NSNumber {
|
|
218
|
+
if isKnownBooleanMetadataKey(item.key) {
|
|
219
|
+
serialized.setBoolean(key: item.key, value: number.boolValue)
|
|
220
|
+
} else if isKnownNumericMetadataKey(item.key) {
|
|
221
|
+
serialized.setDouble(key: item.key, value: number.doubleValue)
|
|
222
|
+
} else if CFGetTypeID(number) == CFBooleanGetTypeID() {
|
|
223
|
+
serialized.setBoolean(key: item.key, value: number.boolValue)
|
|
224
|
+
} else {
|
|
225
|
+
serialized.setDouble(key: item.key, value: number.doubleValue)
|
|
226
|
+
}
|
|
227
|
+
continue
|
|
228
|
+
}
|
|
229
|
+
|
|
274
230
|
if let bool = item.value as? Bool {
|
|
275
231
|
serialized.setBoolean(key: item.key, value: bool)
|
|
232
|
+
continue
|
|
276
233
|
}
|
|
277
234
|
|
|
278
235
|
if let str = item.value as? String {
|
|
279
236
|
serialized.setString(key: item.key, value: str)
|
|
237
|
+
continue
|
|
280
238
|
}
|
|
281
239
|
|
|
282
240
|
if let double = item.value as? Double {
|
|
283
241
|
serialized.setDouble(key: item.key, value: double)
|
|
242
|
+
continue
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if let date = item.value as? Date {
|
|
246
|
+
serialized.setString(
|
|
247
|
+
key: item.key,
|
|
248
|
+
value: metadataDateFormatter.string(from: date)
|
|
249
|
+
)
|
|
250
|
+
continue
|
|
284
251
|
}
|
|
285
252
|
|
|
286
253
|
if let quantity = item.value as? HKQuantity {
|
|
287
254
|
if let s = serializeUnknownQuantity(quantity: quantity) {
|
|
288
255
|
serialized.setObject(key: item.key, value: s)
|
|
289
256
|
}
|
|
257
|
+
continue
|
|
290
258
|
}
|
|
291
259
|
|
|
292
260
|
if let dict = item.value as? [String: AnyValue] {
|
|
@@ -40,42 +40,10 @@ import NitroModules
|
|
|
40
40
|
startDate: sample.startDate,
|
|
41
41
|
endDate: sample.endDate,
|
|
42
42
|
hasUndeterminedDuration: sample.hasUndeterminedDuration,
|
|
43
|
-
|
|
44
|
-
metadataWeatherCondition: serializeWeatherCondition(
|
|
45
|
-
sample.metadata?[HKMetadataKeyWeatherCondition] as? HKWeatherCondition),
|
|
46
|
-
metadataWeatherHumidity: serializeUnknownQuantityTyped(
|
|
47
|
-
quantity: sample.metadata?[HKMetadataKeyWeatherHumidity] as? HKQuantity),
|
|
48
|
-
metadataWeatherTemperature: serializeUnknownQuantityTyped(
|
|
49
|
-
quantity: sample.metadata?[HKMetadataKeyWeatherTemperature] as? HKQuantity),
|
|
50
|
-
metadataInsulinDeliveryReason: serializeInsulinDeliveryReason(
|
|
51
|
-
sample.metadata?[HKMetadataKeyInsulinDeliveryReason] as? HKInsulinDeliveryReason),
|
|
52
|
-
metadataHeartRateMotionContext: serializeHeartRateMotionContext(
|
|
53
|
-
sample.metadata?[HKMetadataKeyHeartRateMotionContext] as? HKHeartRateMotionContext),
|
|
54
|
-
|
|
43
|
+
metadata: serializeMetadata(sample.metadata),
|
|
55
44
|
uuid: sample.uuid.uuidString,
|
|
56
45
|
sourceRevision: serializeSourceRevision(sample.sourceRevision),
|
|
57
|
-
device: serializeDevice(hkDevice: sample.device)
|
|
58
|
-
metadata: serializeMetadata(sample.metadata),
|
|
59
|
-
|
|
60
|
-
metadataExternalUUID: sample.metadata?[HKMetadataKeyExternalUUID] as? String,
|
|
61
|
-
metadataTimeZone: sample.metadata?[HKMetadataKeyTimeZone] as? String,
|
|
62
|
-
metadataWasUserEntered: sample.metadata?[HKMetadataKeyWasUserEntered] as? Bool,
|
|
63
|
-
metadataDeviceSerialNumber: sample.metadata?[HKMetadataKeyDeviceSerialNumber] as? String,
|
|
64
|
-
metadataUdiDeviceIdentifier: sample.metadata?[HKMetadataKeyUDIDeviceIdentifier] as? String,
|
|
65
|
-
metadataUdiProductionIdentifier: sample.metadata?[HKMetadataKeyUDIProductionIdentifier]
|
|
66
|
-
as? String,
|
|
67
|
-
metadataDigitalSignature: sample.metadata?[HKMetadataKeyDigitalSignature] as? String,
|
|
68
|
-
metadataDeviceName: sample.metadata?[HKMetadataKeyDeviceName] as? String,
|
|
69
|
-
metadataDeviceManufacturerName: sample.metadata?[HKMetadataKeyDeviceManufacturerName]
|
|
70
|
-
as? String,
|
|
71
|
-
metadataSyncIdentifier: sample.metadata?[HKMetadataKeySyncIdentifier] as? String,
|
|
72
|
-
metadataSyncVersion: sample.metadata?[HKMetadataKeySyncVersion] as? Double,
|
|
73
|
-
metadataWasTakenInLab: sample.metadata?[HKMetadataKeyWasTakenInLab] as? Bool,
|
|
74
|
-
metadataReferenceRangeLowerLimit: sample.metadata?[HKMetadataKeyReferenceRangeLowerLimit]
|
|
75
|
-
as? Double,
|
|
76
|
-
metadataReferenceRangeUpperLimit: sample.metadata?[HKMetadataKeyReferenceRangeUpperLimit]
|
|
77
|
-
as? Double,
|
|
78
|
-
metadataAlgorithmVersion: sample.metadata?[HKMetadataKeyAlgorithmVersion] as? Double
|
|
46
|
+
device: serializeDevice(hkDevice: sample.device)
|
|
79
47
|
)
|
|
80
48
|
}
|
|
81
49
|
|
package/ios/WorkoutProxy.swift
CHANGED
|
@@ -222,40 +222,14 @@ class WorkoutProxy: HybridWorkoutProxySpec {
|
|
|
222
222
|
totalFlightsClimbed: self.totalFlightsClimbed,
|
|
223
223
|
events: self.events,
|
|
224
224
|
activities: self.activities,
|
|
225
|
-
|
|
226
|
-
metadataElevationAscended: self.metadataElevationAscended,
|
|
227
|
-
metadataElevationDescended: self.metadataElevationDescended,
|
|
228
|
-
metadataIndoorWorkout: self.metadataIndoorWorkout,
|
|
229
|
-
metadataAverageSpeed: self.metadataAverageSpeed,
|
|
230
|
-
metadataMaximumSpeed: self.metadataMaximumSpeed,
|
|
225
|
+
metadata: self.metadata,
|
|
231
226
|
sampleType: self.sampleType,
|
|
232
227
|
startDate: self.startDate,
|
|
233
228
|
endDate: self.endDate,
|
|
234
229
|
hasUndeterminedDuration: self.hasUndeterminedDuration,
|
|
235
|
-
metadataWeatherCondition: self.metadataWeatherCondition,
|
|
236
|
-
metadataWeatherHumidity: self.metadataWeatherHumidity,
|
|
237
|
-
metadataWeatherTemperature: self.metadataWeatherTemperature,
|
|
238
|
-
metadataInsulinDeliveryReason: self.metadataInsulinDeliveryReason,
|
|
239
|
-
metadataHeartRateMotionContext: self.metadataHeartRateMotionContext,
|
|
240
230
|
uuid: self.uuid,
|
|
241
231
|
sourceRevision: self.sourceRevision,
|
|
242
|
-
device: self.device
|
|
243
|
-
metadata: self.metadata,
|
|
244
|
-
metadataExternalUUID: self.metadataExternalUUID,
|
|
245
|
-
metadataTimeZone: self.metadataTimeZone,
|
|
246
|
-
metadataWasUserEntered: self.metadataWasUserEntered,
|
|
247
|
-
metadataDeviceSerialNumber: self.metadataDeviceSerialNumber,
|
|
248
|
-
metadataUdiDeviceIdentifier: self.metadataUdiDeviceIdentifier,
|
|
249
|
-
metadataUdiProductionIdentifier: self.metadataUdiProductionIdentifier,
|
|
250
|
-
metadataDigitalSignature: self.metadataDigitalSignature,
|
|
251
|
-
metadataDeviceName: self.metadataDeviceName,
|
|
252
|
-
metadataDeviceManufacturerName: self.metadataDeviceManufacturerName,
|
|
253
|
-
metadataSyncIdentifier: self.metadataSyncIdentifier,
|
|
254
|
-
metadataSyncVersion: self.metadataSyncVersion,
|
|
255
|
-
metadataWasTakenInLab: self.metadataWasTakenInLab,
|
|
256
|
-
metadataReferenceRangeLowerLimit: self.metadataReferenceRangeLowerLimit,
|
|
257
|
-
metadataReferenceRangeUpperLimit: self.metadataReferenceRangeUpperLimit,
|
|
258
|
-
metadataAlgorithmVersion: self.metadataAlgorithmVersion
|
|
232
|
+
device: self.device
|
|
259
233
|
)
|
|
260
234
|
}
|
|
261
235
|
|
|
@@ -369,126 +343,6 @@ class WorkoutProxy: HybridWorkoutProxySpec {
|
|
|
369
343
|
return workout.hasUndeterminedDuration
|
|
370
344
|
}
|
|
371
345
|
|
|
372
|
-
// Weather metadata
|
|
373
|
-
var metadataWeatherCondition: WeatherCondition? {
|
|
374
|
-
return serializeWeatherCondition(
|
|
375
|
-
workout.metadata?[HKMetadataKeyWeatherCondition] as? HKWeatherCondition)
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
var metadataWeatherHumidity: Quantity? {
|
|
379
|
-
return serializeUnknownQuantityTyped(
|
|
380
|
-
quantity: workout.metadata?[HKMetadataKeyWeatherHumidity] as? HKQuantity)
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
var metadataWeatherTemperature: Quantity? {
|
|
384
|
-
return serializeUnknownQuantityTyped(
|
|
385
|
-
quantity: workout.metadata?[HKMetadataKeyWeatherTemperature] as? HKQuantity)
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
var metadataInsulinDeliveryReason: InsulinDeliveryReason? {
|
|
389
|
-
return serializeInsulinDeliveryReason(
|
|
390
|
-
workout.metadata?[HKMetadataKeyInsulinDeliveryReason] as? HKInsulinDeliveryReason)
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
var metadataHeartRateMotionContext: HeartRateMotionContext? {
|
|
394
|
-
return serializeHeartRateMotionContext(
|
|
395
|
-
workout.metadata?[HKMetadataKeyHeartRateMotionContext] as? HKHeartRateMotionContext)
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
// Workout-specific metadata
|
|
399
|
-
var metadataAverageMETs: Quantity? {
|
|
400
|
-
return serializeUnknownQuantityTyped(
|
|
401
|
-
quantity: workout.metadata?[HKMetadataKeyAverageMETs] as? HKQuantity)
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
var metadataElevationAscended: Quantity? {
|
|
405
|
-
return serializeUnknownQuantityTyped(
|
|
406
|
-
quantity: workout.metadata?[HKMetadataKeyElevationAscended] as? HKQuantity)
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
var metadataElevationDescended: Quantity? {
|
|
410
|
-
if #available(iOS 18.0, *) {
|
|
411
|
-
return serializeUnknownQuantityTyped(
|
|
412
|
-
quantity: workout.metadata?[HKMetadataKeyElevationDescended] as? HKQuantity)
|
|
413
|
-
}
|
|
414
|
-
return nil
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
var metadataIndoorWorkout: Bool? {
|
|
418
|
-
return workout.metadata?[HKMetadataKeyIndoorWorkout] as? Bool
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
var metadataAverageSpeed: Quantity? {
|
|
422
|
-
return serializeUnknownQuantityTyped(
|
|
423
|
-
quantity: workout.metadata?[HKMetadataKeyAverageSpeed] as? HKQuantity)
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
var metadataMaximumSpeed: Quantity? {
|
|
427
|
-
return serializeUnknownQuantityTyped(
|
|
428
|
-
quantity: workout.metadata?[HKMetadataKeyMaximumSpeed] as? HKQuantity)
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// BaseObject metadata
|
|
432
|
-
var metadataExternalUUID: String? {
|
|
433
|
-
return workout.metadata?[HKMetadataKeyExternalUUID] as? String
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
var metadataTimeZone: String? {
|
|
437
|
-
return workout.metadata?[HKMetadataKeyTimeZone] as? String
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
var metadataWasUserEntered: Bool? {
|
|
441
|
-
return workout.metadata?[HKMetadataKeyWasUserEntered] as? Bool
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
var metadataDeviceSerialNumber: String? {
|
|
445
|
-
return workout.metadata?[HKMetadataKeyDeviceSerialNumber] as? String
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
var metadataUdiDeviceIdentifier: String? {
|
|
449
|
-
return workout.metadata?[HKMetadataKeyUDIDeviceIdentifier] as? String
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
var metadataUdiProductionIdentifier: String? {
|
|
453
|
-
return workout.metadata?[HKMetadataKeyUDIProductionIdentifier] as? String
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
var metadataDigitalSignature: String? {
|
|
457
|
-
return workout.metadata?[HKMetadataKeyDigitalSignature] as? String
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
var metadataDeviceName: String? {
|
|
461
|
-
return workout.metadata?[HKMetadataKeyDeviceName] as? String
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
var metadataDeviceManufacturerName: String? {
|
|
465
|
-
return workout.metadata?[HKMetadataKeyDeviceManufacturerName] as? String
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
var metadataSyncIdentifier: String? {
|
|
469
|
-
return workout.metadata?[HKMetadataKeySyncIdentifier] as? String
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
var metadataSyncVersion: Double? {
|
|
473
|
-
return workout.metadata?[HKMetadataKeySyncVersion] as? Double
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
var metadataWasTakenInLab: Bool? {
|
|
477
|
-
return workout.metadata?[HKMetadataKeyWasTakenInLab] as? Bool
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
var metadataReferenceRangeLowerLimit: Double? {
|
|
481
|
-
return workout.metadata?[HKMetadataKeyReferenceRangeLowerLimit] as? Double
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
var metadataReferenceRangeUpperLimit: Double? {
|
|
485
|
-
return workout.metadata?[HKMetadataKeyReferenceRangeUpperLimit] as? Double
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
var metadataAlgorithmVersion: Double? {
|
|
489
|
-
return workout.metadata?[HKMetadataKeyAlgorithmVersion] as? Double
|
|
490
|
-
}
|
|
491
|
-
|
|
492
346
|
var events: [WorkoutEvent]? {
|
|
493
347
|
if let hkWorkoutEvents = workout.workoutEvents {
|
|
494
348
|
return hkWorkoutEvents.compactMap { event in
|
|
@@ -555,4 +409,4 @@ class WorkoutProxy: HybridWorkoutProxySpec {
|
|
|
555
409
|
return try await getSerializedWorkoutLocations(workout: self.workout)
|
|
556
410
|
}
|
|
557
411
|
}
|
|
558
|
-
}
|
|
412
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// AUTO-GENERATED FILE. DO NOT EDIT.
|
|
2
|
+
// Source: scripts/generate-healthkit.ts
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
private let healthkitBooleanMetadataKeys: Set<String> = [
|
|
7
|
+
"HKAppleDeviceCalibrated",
|
|
8
|
+
"HKAppleFitnessPlusSession",
|
|
9
|
+
"HKCoachedWorkout",
|
|
10
|
+
"HKGroupFitness",
|
|
11
|
+
"HKIndoorWorkout",
|
|
12
|
+
"HKMenstrualCycleStart",
|
|
13
|
+
"HKQuantityClampedToLowerBound",
|
|
14
|
+
"HKQuantityClampedToUpperBound",
|
|
15
|
+
"HKSexualActivityProtectionUsed",
|
|
16
|
+
"HKWasTakenInLab",
|
|
17
|
+
"HKWasUserEntered",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
private let healthkitNumericMetadataKeys: Set<String> = [
|
|
21
|
+
"HKActivityType",
|
|
22
|
+
"HKAlgorithmVersion",
|
|
23
|
+
"HKAppleECGAlgorithmVersion",
|
|
24
|
+
"HKBloodGlucoseMealTime",
|
|
25
|
+
"HKBodyTemperatureSensorLocation",
|
|
26
|
+
"HKCyclingFunctionalThresholdPowerTestType",
|
|
27
|
+
"HKDevicePlacementSide",
|
|
28
|
+
"HKHeartRateMotionContext",
|
|
29
|
+
"HKHeartRateRecoveryActivityType",
|
|
30
|
+
"HKHeartRateRecoveryTestType",
|
|
31
|
+
"HKHeartRateSensorLocation",
|
|
32
|
+
"HKInsulinDeliveryReason",
|
|
33
|
+
"HKPhysicalEffortEstimationType",
|
|
34
|
+
"HKReferenceRangeLowerLimit",
|
|
35
|
+
"HKReferenceRangeUpperLimit",
|
|
36
|
+
"HKSwimmingLocationType",
|
|
37
|
+
"HKSwimmingStrokeStyle",
|
|
38
|
+
"HKSWOLFScore",
|
|
39
|
+
"HKSyncVersion",
|
|
40
|
+
"HKUserMotionContext",
|
|
41
|
+
"HKVO2MaxTestType",
|
|
42
|
+
"HKWaterSalinity",
|
|
43
|
+
"HKWeatherCondition",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
func isKnownBooleanMetadataKey(_ key: String) -> Bool {
|
|
47
|
+
healthkitBooleanMetadataKeys.contains(key)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
func isKnownNumericMetadataKey(_ key: String) -> Bool {
|
|
51
|
+
healthkitNumericMetadataKeys.contains(key)
|
|
52
|
+
}
|