Terra

Integration

API
Unified API
SDK
SDK
Authentication
Authentication
Streaming
Streaming
Blood
Blood Report API
Planned Workout
Planned Workout
AI Interface
AI Interface

User engagement

Graph API
Graph API
Scores
Health Scores
Rewards
Health Rewards

Use cases

Enterprise
Enterprise
Insurance
Insurance

Developers

Wearable Data
Wearable Data
Community
Community
Documentation
Documentation

Learn

Blog
Blog
Podcast
Podcast
Events
Events
Reports
Reports

Company

Customers
Customers
Careers
Careers
Partners
Partners
Support
Support
Become an integration
Become an integration


Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.

zap

Latest

zap

Popular

API

Unified API

SDK

Phone SDK

Authentication

Widget

Streaming

Streaming

Graph API

Graph API

How to get Apple HealthKit data with the Terra iOS SDK

All

CostlyQuail25 months ago

How do I get started with the TerraManager in the iOS sdk. We have already followed the guide on enabling HealthKit permissions but the flow does not make sense to me

terra

Chandruadmin25 months ago

Hi there.

After following the guide on setting up the dependencies for the iOS sdk, the flow would look something like this:

  1. Create a manager instance:
  1. Generate an auth token. For this, you should implement a backend endpoint to get the token from Terra using your dev-id, x-api-key and then call this endpoint from your mobile app (protected by your auth). For example

And then request this endpoint from your app and use the token

  1. Then initialise a connection, which should pull up the HealthKit permissions screen (this only needs to be done once):
  1. Now request data as desired (ensuring you use swift date objects):