Integrating with HealthKit
Apple's HealthKit provides a central repository for health and fitness data on iPhone and Apple Watch. With a quick setup, you can enable a HealthKit integration with your app, allowing Point SDK to collect data from HealthKit and upload it to Point's database to be processed.
HealthKit stores all user data on the user's device, so all data collection happens locally, on the device. This means that this integration is only possible in iPhone devices, as other devices don't provide support for HealthKit.
Setting Up your Project
Before you start using Point SDK, you must perform the following changes to your Xcode project settings:
Enable HealthKit capabilities in your app.
Add permissions configuration
Enable HealthKit capabilities
In Xcode, select the project and add the HealthKit capability. It is highly recommended that you also enable Background Delivery and Background fetch capabilities. For a detailed discussion about enabling Health Kit capabilities, see Configure HealthKit at the official Xcode Help.
You must provide a message to the user explaining why the app is requesting permission to read samples from the HealthKit store. To do so, set the NSHealthShareUsageDescription key to customize this message. For projects created using Xcode 13 or later, set these keys in the Target Properties list on the app’s Info tab. For projects created with Xcode 12 or earlier, set these keys in the apps Info.plist file. For more information, see Information Property List.
Point SDK provides an abstraction of the main functionalities from Apple's HealthKit in order to collect and upload health samples in an optimized and easy-to-implement way.
- Check PointHealthKit for detailed instructions in the Swift SDK.
- Check PointHealthKit for detailed instructions in the React Native SDK.
- Check PointHealthKit for detailed instructions in the Capacitor SDK.