You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would get the data that is aggregated for the day. In this case assuming left bound is November.25 12am and right bound is November.25 11:59pm, this above query should return a list of two HealthDataPoints such that the first point represents the average bpm for the first 12 hours, and the second for the average bpm for the later 12ish hours.
Actual Behavior
**Instead I see the following error in Xcode: Thread 1: "Statistics option HKStatisticsOptionCumulativeSum is not compatible with discrete data type HKQuantityTypeIdentifierHeartRate"**
If I am misunderstanding something any guidance would be very helpful!
Flutter Doctor Output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.88.1)
[✓] Connected device (6 available)
[✓] Network resources
• No issues found!
iarata
changed the title
[<Health> <11.1.0>] getHealthIntervalDataFromTypes(...) giving error for returning quantity data type aggregated values (Testing on IOS)
[Health: 11.1.0] getHealthIntervalDataFromTypes(...) giving error for returning quantity data type aggregated values (Testing on IOS)
Nov 27, 2024
I also tested the above variables and got the same error. I believe this is happening due to the way we query on this line inside the SwiftHealthPlugin.swift file**(Line: 1093)**:
Looking at the following link as reference, depending on the dataType we have to specifiy in option if we want a .cumulativeSum or .discreteAverage I believe(Heart rate for example, and the above variables in this comment would only take .discreteAverage):
Plugin Name
Health
Plugin Version
11.1.0
Device
Iphone 14 Pro Max
Operating System
IOS 18.1.1
Describe the bug
The bug is that getHealthIntervalDataFromTypes() doesn't support all quantity type objects queries.
It was also a bit confusing which HealthDataType variables are supported but I believe IOS Health documentation states it:
All quantity type objects:
https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
In my case when i was testing it worked for the following variables:
But when it came to using HealthDataType.HEART_RATE I run into the following error in Xcode:
Thread 1: "Statistics option HKStatisticsOptionCumulativeSum is not compatible with discrete data type HKQuantityTypeIdentifierHeartRate"
Steps to Reproduce
Expected Behavior
I would get the data that is aggregated for the day. In this case assuming left bound is November.25 12am and right bound is November.25 11:59pm, this above query should return a list of two HealthDataPoints such that the first point represents the average bpm for the first 12 hours, and the second for the average bpm for the later 12ish hours.
Actual Behavior
**Instead I see the following error in Xcode:
Thread 1: "Statistics option HKStatisticsOptionCumulativeSum is not compatible with discrete data type HKQuantityTypeIdentifierHeartRate"**
If I am misunderstanding something any guidance would be very helpful!
Flutter Doctor Output
Additional Information
Additional resources I looked at:
https://developer.apple.com/documentation/healthkit/hkquantitytypeidentifier
https://developer.apple.com/documentation/healthkit/hkstatisticscollectionquery
https://developer.apple.com/documentation/healthkit/queries/executing_statistics_collection_queries
The text was updated successfully, but these errors were encountered: