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: exposing HKHeartbeatSeriesQuery for Heartbeat series data #58

Merged

Conversation

oldratip
Copy link
Contributor

@oldratip oldratip commented Apr 24, 2023

This PR adds functionality to query HKHeartbeatSeriesSample. Closes #57.

  • To obtain the raw heartbeat data it uses a HKHeartbeatSeriesQuery. Another way to do it, which is probably a little more concise, would be using a HKHeartbeatSeriesQueryDescriptor. However, this requires iOS 15.4 and is not consistent with how the workout routes are currently obtained in the library (HKWorkoutRouteQueryDescriptor also exists).
  • Exposes queryHeartbeatSeriesSamples.
  • Adds a way to test it in the example app by running the anchored query with two samples at a time (see below).
  • Deeper integration in the rest of the library (e.g., deleteSamples) needs a bit of reworking in the types and partially also the Swift code, as HKDataTypeIdentifierHeartbeatSeries is not a HKQuantityTypeIdentifier, so this probably warrants a separate PR.

new_example_button new_example_alert

@oldratip oldratip force-pushed the feat/exposing-heartbeat-series-query branch from 6ff1610 to e7c3cb2 Compare April 24, 2023 20:55
@oldratip
Copy link
Contributor Author

FYI, not sure why the tests fail, but working with a downgraded version of node (see here) seems to work. I tested it locally and node >= 18.16.0 fails, but 18.15.0 passes.

@github-actions
Copy link

Expo preview is ready for review.

There should soon be a new native build available here

With that installed just scan this QR code:
QR Preview

@robertherber robertherber merged commit 6ed0cf6 into kingstinct:master Apr 25, 2023
@robertherber
Copy link
Member

Thanks a lot for this PR - it looks great! Merged and released in 6.1.0 :)

FYI, not sure why the tests fail, but working with a downgraded version of node (see here) seems to work. I tested it locally and node >= 18.16.0 fails, but 18.15.0 passes.

Realised the test workflow didn't use the nvmrc-version of node (still at 16) - now it's working :)

@oldratip oldratip deleted the feat/exposing-heartbeat-series-query branch April 25, 2023 11:49
@oldratip oldratip restored the feat/exposing-heartbeat-series-query branch April 25, 2023 14:04
@oldratip oldratip deleted the feat/exposing-heartbeat-series-query branch April 25, 2023 14:05
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.

Feature: exposing HKHeartbeatSeriesQuery for Heartbeat series data
2 participants