Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Health]: Improve support for RecordingMethod on Health Connect and HKWasUserEntered on iOS #1023

Merged
merged 35 commits into from
Aug 30, 2024

Conversation

SlimShadyIAm
Copy link
Contributor

Introduction

Google Health Connect and Apple HealthKit both provide ways to distinguish samples collected "automatically" and manually entered data by the user.

Problem

Previously, the Health package did not support writing this to this metadata field when writing data, and in many cases you could not query or filter by the type when reading data (especially on Android).


Breaking changes

  • Introduce a new RecordingMethod enum, containing the 4 values that Health Connect defines.
  • Remove isManualEntry from HealthDataPoint in favor of recordingMethod, of which the value is an enum RecordingMethod
  • Remove includeManualEntry (previously a boolean) in favor of recordingMethodsToFilter, which is a list of RecordingMethod. This change affects the following functions for querying:
    • getHealthDataFromTypes
    • getHealthIntervalDataFromTypes
  • Note: getHealthAggregateDataFromTypes is unaffected.
  • When writing data you can now specify the recordingMethod to write to HealthKit and Health Connect stores, and when querying the data again it will be included in the metadata. The default value is RecordingMethod.automatic. This change affects:
    • writeHealthData
    • writeWorkoutData
    • writeMealData
    • writeBloodPressure
    • writeBloodOxygen
    • writeMenstruationFlow

Other improvements

  • In the example app, you can now filter data by recording method when calling "Fetch data" and "Fetch step data"

@SlimShadyIAm SlimShadyIAm changed the base branch from feature/remove-google-fit to master August 15, 2024 15:10
@SlimShadyIAm SlimShadyIAm changed the base branch from master to feature/remove-google-fit August 15, 2024 15:16
@SlimShadyIAm SlimShadyIAm linked an issue Aug 23, 2024 that may be closed by this pull request
@SlimShadyIAm SlimShadyIAm changed the base branch from feature/remove-google-fit to master August 29, 2024 14:28
@SlimShadyIAm SlimShadyIAm changed the base branch from master to feature/remove-google-fit August 29, 2024 14:28
@SlimShadyIAm SlimShadyIAm changed the base branch from feature/remove-google-fit to master August 29, 2024 14:44
@SlimShadyIAm SlimShadyIAm marked this pull request as ready for review August 30, 2024 08:40
Copy link
Contributor

@bardram bardram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good and it runs on iOS

@SlimShadyIAm SlimShadyIAm merged commit ce4d444 into master Aug 30, 2024
1 check passed
@SlimShadyIAm SlimShadyIAm deleted the feature/recording-method branch August 30, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

health 10.2.0 isManualEntry always false
2 participants