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
- Characteristic data (characteristic data)
- iPhone and Apple Watch each have their own HealthKit store
Setting up HealthKit
-
-
Add the HealthKit capability to the target
- State after adding
- What is "Clinical Health Records"?
Clinical Health Records refers to records containing information about a patient's health condition and the treatment they received.
- What is "Clinical Health Records"?
-
Add the HealthKit capability to the target
-
Configuring
NSHealthUpdateUsageDescriptionandNSHealthShareUsageDescription- Configure
NSHealthUpdateUsageDescriptionandNSHealthShareUsageDescriptioninInfo.plist - For Info.plist configuration in Xcode 13 and later, refer to the following:
- Configure
-
Create the app's HealthKit store.
Test Data Related
-
https://github.com/ashtom/hkimport
- Can import data from an actual device into the simulator
-
https://github.com/dogsheep/healthkit-to-sqlite/tree/main
↑ There is also something like this
- Can convert exported data into a SQLite database
Discussion