healthkit

Integrate HealthKit to read, write, and query health data.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/onymchat/onym-ios --skill healthkit-onymchat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: healthkit
Source: https://github.com/onymchat/onym-ios/tree/main/.claude/skills/healthkit
Command: npx skills add https://github.com/onymchat/onym-ios --skill healthkit-onymchat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers building HealthKit-enabled apps often struggle to securely access, authorize, and query health data from the Apple Health store. This skill provides clear patterns for requesting the right permissions, performing read and write operations, and handling background delivery and live workout data.

Core Features & Use Cases

  • Authorization management and data type scoping
  • Reading samples and statistics with modern async descriptors
  • Background delivery and live workout lifecycle management

Quick Start

Start by enabling HealthKit capability in Xcode, request authorization for the necessary data types, and begin reading or writing data as your app lifecycle requires.

Frequently Asked Questions about healthkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I request HealthKit authorization in my iOS app?

Request HealthKit authorization by enabling the capability in Xcode, adding Info.plist usage descriptions, and calling HKHealthStore to request access for your required data types. Always perform an availability check before requesting permissions.

What's the best way to query HealthKit workout and statistics data?

Query HealthKit workout and statistics data using modern async descriptors like HKSampleQueryDescriptor and HKStatisticsQueryDescriptor. These provide a streamlined Swift concurrency pattern for reading samples and calculating health statistics.

Can I use HealthKit background delivery for live workout sessions?

Yes, you can use HealthKit background delivery alongside HKWorkoutSession to manage live workout lifecycles. This enables your iOS app to receive updates and track health data continuously even when running in the background.

Do I need a HealthKit-enabled project to read and write health data?

Yes, reading and writing health data requires a HealthKit-enabled Xcode project with proper Info.plist descriptions. You must also use the HKHealthStore singleton to securely perform read and write operations on the Apple Health store.

Why does my HealthKit query return no data on iOS?

Your HealthKit query may return no data if authorization was not granted for the requested data types, or if you failed to perform an HKHealthStore availability check. Proper data type scoping and correct permission requests are required before querying.