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

Add source information to HealthDataPoint #281

Merged
merged 2 commits into from
May 17, 2021
Merged

Conversation

oakmad
Copy link
Contributor

@oakmad oakmad commented Feb 3, 2021

Added two new fields to the HealthDataPoint, SourceId and SourceName and populate when data is read. This allows datapoints to be disambigous and in some cases allows us to get more accurate data. For example the number of steps can be reported from Apple Health and Watch and without source data they are aggregated into just "steps" producing an innacurate result.

On iOS source is derived from sample.sourceRevision.source (https://developer.apple.com/documentation/healthkit/hksourcerevision) with id coming from bundleIdentifier ("com.apple.health") and name from name ("Health")

On Android source is derived from dataPoint.getOriginalDataSource() (https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataPoint#getOriginalDataSource())with id from getStreamIdentifier and name getAppPackageName

oakmad and others added 2 commits February 3, 2021 13:28
Added two new fields to the HealthDataPoint, SourceId and SourceName and populate when data is read. This allows datapoints to be disambigous and in some cases allows us to get more accurate data. For example the number of steps can be reported from Apple Health and Watch and without source data they are aggregated into just "steps" producing an innacurate result.

On iOS source is derived from sample.sourceRevision.source (https://developer.apple.com/documentation/healthkit/hksourcerevision) with id coming from bundleIdentifier ("com.apple.health") and name from name ("Health")

On Android source is derived from dataPoint.getOriginalDataSource() (https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataPoint#getOriginalDataSource())with id from getStreamIdentifier and name getAppPackageName
@bardram bardram merged commit 0ce8d12 into cph-cachet:master May 17, 2021
@bardram
Copy link
Contributor

bardram commented May 17, 2021

Thanks for this PR - have been incorporated and published as version 3.0.6.

hibitness-quan-nguyen2 pushed a commit to hibitness/flutter-plugins that referenced this pull request Dec 18, 2023
Add source information to HealthDataPoint
@nikhilmehta0399
Copy link

Does it give me total steps in given day or list of all the sessions of steps?

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.

3 participants