What problem does it solve?
Apple Health stores a vast array of health and fitness data and apps need clear guidance on how to securely read, write, and query it within a modern iOS app. This skill consolidates authorization flows, data queries (sample, statistics, and time-series), background delivery, and workout session handling into a cohesive integration.
Core Features & Use Cases
- Authorization & Data Access: request and manage permissions for required data types (e.g., stepCount, heartRate) and perform read/write operations with proper privacy handling.
- Workouts, Background Delivery & Live Data: orchestrate HKWorkoutSession and HKLiveWorkoutBuilder, enable background delivery, and capture live metrics during workouts.
- Platform Readiness & Real-World Use Case: gate features by availability (iOS 17+/iPadOS 17+), supporting a health-dashboard use case that tracks daily steps, heart rate, and workouts across devices.
Quick Start
Request authorization for the necessary HealthKit data types and fetch today's step count to populate your dashboard.