iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🏥

HealthKit Catch-up

に公開

HealthKit

Health & Fitness - Apple Developer

About the HealthKit Framework

  • Share health and fitness data between apps
  • Limit data types and units to a predefined list
  • HealthKit data
    • Characteristic data (characteristic data)
      • User's date of birth, blood type, biological sex, skin type, etc.
      • Applications cannot save characteristic data
    • Sample data (sample)
    • Workout data (workout)
    • Source data
    • Deleted objects
    • HKObject
      • The superclass for all HealthKit sample types
  • iPhone and Apple Watch each have their own HealthKit store

Setting up HealthKit

  1. Enable HealthKit in your app

    • Add the HealthKit capability to the target
      image1.png
    • State after adding
      image2.png
      • What is "Clinical Health Records"?

        Clinical Health Records refers to records containing information about a patient's health condition and the treatment they received.

  2. Configuring NSHealthUpdateUsageDescription and NSHealthShareUsageDescription

  3. Verify that HealthKit is available on the current device.

  4. Create the app's HealthKit store.

  5. Request permission to read and share data.

Test Data Related

Helpful Repositories

Reference URLs

Discussion