Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Apple Health sync with per-type toggles, workout export, and profile import - #80

Merged
saksham2001 merged 3 commits into
mainfrom
apple-health-sync
Jul 11, 2026
Merged

saksham2001 merged 3 commits into
mainfrom
apple-health-sync

Conversation

@saksham2001

Copy link
Copy Markdown
Owner

Summary

Apple Health (HealthKit) integration, building on @hoveeman's #16 (thank you!) ported onto current main with user-facing customization: a master sync toggle (default off), per-data-type toggles (HR, SpO₂, HRV, temperature, sleep, steps/activity), a dedicated workout-export toggle (with GPS routes), and an ask-on-first-enable choice between full-history backfill and new-data-only.

Key differences vs #16: idempotent writes via HKMetadataKeySyncIdentifier/SyncVersion upsert (no delete-then-rewrite), one debounced HealthSyncPublisher instead of per-call-site sync triggers, watermark-based export tracking (no schema changes — syncedAt keeps its ring-freshness meaning), and read side limited to a profile import button (age/sex/height/weight, read-only authorization). Also adds a "Use advanced calories" toggle for the existing Keytel/MET estimator. Includes a "Remove PulseLoop data from Apple Health" action.

Deferred follow-ups: blood-pressure export (needs HKCorrelation), workout import, iOS 18 effort scores.

Related issues

Supersedes #16.

Type of change

  • ✨ New feature (non-breaking change that adds functionality)
  • 🎨 UI / DesignSystem change

How was this tested?

  • Added / updated unit tests (PulseLoopTests) — 27 new tests (mappings, plausibility bounds, sync-ID determinism, prefs tolerant decode, watermark reset, calorie gate)
  • Ran the test suite locally (⌘U in Xcode) — all 64 suites pass; SwiftLint clean
  • Manual Health-app QA on simulator/device still pending (auth flows, duplicate-free re-export, Move-ring netting)

Privacy & data

  • This change does not send health data off-device without explicit user action — everything is gated behind an opt-in master toggle (default off) plus per-type toggles; HealthKit stays on-device.
  • No secrets, API keys, or personal data are committed.

Note for release: App Review Guideline 5.1.3 requires a privacy policy for HealthKit apps.

Checklist

  • My code follows the project's style (SwiftLint passes).
  • I ran the tests and they pass.
  • I updated docs / README where relevant.
  • I read the Contributing guide.

@saksham2001
saksham2001 merged commit c1275ad into main Jul 11, 2026
2 checks passed
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.

1 participant