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

feat: Add sources metadata to statistics collection query #386

Merged

Conversation

cbxalves
Copy link
Contributor

Description

For the statistics collection query, HealthKit partitions the matching samples into a set of time intervals and performs the calculations over each interval separately. By default, this query automatically merges the data from all of your data sources before performing the calculations.

This PR introduces the capability to request statistical data separately for each data source, by setting the HKStatisticsOptionSeparateBySource option.

This is particularly valuable for scenarios where understanding the contribution of each individual data source is crucial (e.g., understanding how different devices or apps contribute to the total daily step count).

PS: I've only updated the getDailyStepCountSamples documentation with the new output data, but I can update other docs if this feature proves valuable.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have checked my code and corrected any misspellings

@gustavodebiasi
Copy link

Hey @ruan-azevedo can you help us with this PR? 🥺

@ruan-azevedo ruan-azevedo merged commit 0b1792d into agencyenterprise:master Oct 15, 2024
@ruan-azevedo
Copy link
Contributor

ruan-azevedo commented Oct 15, 2024

Hey @gustavodebiasi @fjpamaral @cbxalves just released the version v.19.0 to npm with this PR merged.
Thanks for the contribution!

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.

5 participants