> For the complete documentation index, see [llms.txt](https://docs.thryve.health/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thryve.health/integrate-your-mobile-app/setup-thryve-sdk/ios.md).

# iOS

The Thryve iOS SDK is the fastest way to implement Thryve's product into your iOS application and is required to allow users to connect Apple Health as a data source. The Thryve iOS SDK is available as Cocoapods and frameworks. It requires:

* **Xcode:** version 14.2 or later.
* **iOS Target:** version 14 or higher is recommended.

{% tabs %}
{% tab title="Integration via Cocoapods" %}
To integrate the Thryve iOS SDK modules via **Cocoapods** into your application, follow these steps:

1. **Add Thryve Specs Repository**\
   Open your terminal and navigate to your project directory. Then, execute the following command to add the Thryve Specs repository:

   ```
   pod repo add ThryveSpecs https://git.thryve.de/thryve/Specs.git
   ```
2. **Update Your Podfile**\
   Modify your Podfile to include the necessary Thryve SDK modules. Refer to the sample [Podfile](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/ThryveConnectorSample/Podfile?ref_type=heads) provided in the Thryve iOS [Sample App](https://git.thryve.de/thryve/sdk/-/tree/master/iOS?ref_type=heads) for guidance.
3. **Install Pods**\
   Run the following command in your terminal to install the specified pods:

   ```
   pod install
   ```

Ensure you regularly update the Thryve Specs repository to get the latest features and fixes. For more details, visit the Thryve Specs Git repository: [Thryve Specs](https://git.thryve.de/thryve/Specs.git).

```ruby
platform :ios, '13.0'
source 'https://git.thryve.de/thryve/Specs.git'

target 'ThryveConnectorSample' do
 
  use_frameworks!

pod 'ThryveCore', '5.3.1'
pod 'ThryveCommons', '5.3.1'
pod 'ThryveAppleHealth', '5.3.1'
pod 'ThryveShenAI', '5.3.1'
pod 'ThryveObservability', '5.3.1'
pod 'ThryveBLE', '5.3.1'
pod 'ThryveGarminCompanion', '5.3.1'

end
```

{% endtab %}

{% tab title="Integration via frameworks" %}
To integrate the Thryve iOS SDK into your app manually, download the Thryve SDK framework files and sample app code. Follow the instructions below for seamless integration.

| Module Name           | Download Version                                                                                                              |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| ThryveCore            | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_core_sdk_5.3.3.xcframework.zip)                |
| ThryveCommons         | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_commons_sdk_5.3.3.xcframework.zip)             |
| ThryveAppleHealth     | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_apple_health_sdk_5.3.3.xcframework.zip)        |
| ThryveShenAI          | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_module_shen_ai_5.3.3.xcframework.zip)          |
| ShenaiSDK             | [3.0.2](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/ShenaiSDK._3.0.2.xcframework.zip)                     |
| Sample App            | [5.3.3](https://git.thryve.de/thryve/sdk/-/tree/master/iOS/ThryveiOSSampleApp)                                                |
| ThryveObservability   | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_observability_5.3.3.xcframework.zip)           |
| ThryveBLE             | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_ble_5.3.3.xcframework.zip)                     |
| ThryveGarminCompanion | [5.3.3](https://git.thryve.de/thryve/sdk/-/blob/master/iOS/xcframeworks/thryve_module_garmin_companion_5.3.3.xcframework.zip) |

#### Adding and Linking a Framework in Xcode

1. **Add Framework**
   1. Right-click on your Xcode project's root and create a `New Group` named `Framework`.
   2. Drag and drop the extracted `.xcframework` folders from Finder into this group.
   3. In the dialog box, select `Copy items if needed`, `Create folder references`, and choose the targets for the framework.

<figure><img src="https://597945514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXHZczPNWZCe1I09YetDl%2Fuploads%2FKsmyqV30pXfACnKBJ3t9%2Fios-framework-d46453b1.webp?alt=media&amp;token=71f84a15-30c3-4413-9929-837744420c31" alt=""><figcaption></figcaption></figure>

2. **Link Framework**
   1. Navigate to `project root > target > General`.
   2. Add the frameworks to `Frameworks, Libraries, and Embeded Content` by clicking the **+** button.
   3. Select the desired framework, such as `ThryveCore` or `ThryveCommons` .
   4. Choose `Embed & Sign` .

If you have followed the import correctly, the screen should look like this, depending on the imported frameworks.

<figure><img src="https://597945514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXHZczPNWZCe1I09YetDl%2Fuploads%2FKbXcHfQAVpWMMHi0EKuz%2FScreenshot%202025-12-11%20at%2013.29.04.png?alt=media&amp;token=f0726e3b-18ab-4176-a20f-11410393ff7f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
A runtime error such as the following indicates that the `Embed & Sign` setting was not correctly applied to an added framework:

`dyld[5119]: Library not loaded: @rpath/ThryveCommons.framework/ThryveCommons`\
`../ThryveCommons.framework/ThryveCommons' (no such file),`
{% endhint %}
{% endtab %}

{% tab title="Integration via SPM" %}
To integrate the Thryve iOS SDK modules via Swift Package Manager (SPM) into your application, follow these steps:

1. **Add Thryve Package Repository**
   1. In Xcode, navigate to `File > Add Package Dependencies`. In the search field, enter the Thryve package repository URL: \
      \
      `https://git.thryve.de/thryve/Pods` \
      \
      Xcode will find the package. <br>

      <figure><img src="https://597945514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXHZczPNWZCe1I09YetDl%2Fuploads%2FSO1MOi6DT2MEkGwqNCC8%2FScreenshot%202026-04-02%20at%2012.56.32.png?alt=media&amp;token=ad7db38e-0441-4dd6-801c-3ba56263f7e9" alt=""><figcaption></figcaption></figure>

   2. Set the `Dependency Rule` to `Up to Next Major Version` starting from your desired version (e.g. 5.3.1), select your project under `Add to Project`, and click `Add Package`.\ <br>
2. **Choose Package Products**\
   After the package is fetched, Xcode will present a list of available package products.
   1. Select the modules you need and assign them to the appropriate target.&#x20;
   2. Click `Add Package` to confirm.

<figure><img src="https://597945514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXHZczPNWZCe1I09YetDl%2Fuploads%2F5c55UgB1dpcoVc5itVBa%2FScreenshot%202026-04-02%20at%2013.00.26.png?alt=media&amp;token=106fee52-fd87-46ed-b9ef-119e265a7a01" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
If an `Undefined symbol:` error occurs, ensure that all modules use the same SDK version. For example, `ThryveAppleHealth.xcframework` (or Pod) version `5.0.2` cannot be used together with `ThryveCommons.xcframework` (or Pod) version `5.0.4`.
{% endhint %}

## App Store Privacy Compliance Configuration

### Adding a Privacy Manifest File

Starting May 1, 2024, all apps and third-party SDKs must include the use of [required reason API](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api), such as [`UserDefaults`](https://developer.apple.com/documentation/foundation/userdefaults), in their privacy manifest file for App Store Connect approval. Follow these steps:

1. **Create a Privacy Manifest File**: Ensure your app includes a [manifest file](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files).
2. **Specify Privacy API Types**: Add `Privacy Accessed API Types` or `NSPrivacyAccessedAPITypes` to your file.
3. **Provide API Reasoning**: Under `Privacy Accessed API Reasons`, or `NSPrivacyAccessedAPITypeReasons`, list `CA92.1` in an array. More details can be found [here](https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api#4278401).

<details>

<summary>The <code>PrivacyInfo.xcprivacy</code> plist file should look similar to this sample</summary>

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSPrivacyAccessedAPITypes</key>
    <array>
        <dict>
            <key>NSPrivacyAccessedAPITypeReasons</key>
            <array>
                <string>CA92.1</string>
            </array>
            <key>NSPrivacyAccessedAPIType</key>
            <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
        </dict>
    </array>
</dict>
</plist>
```

</details>

## Apple Health (HealthKit) project configuration

### Integrate ThryveAppleHealth module

To add HealthKit to your iOS app:

* Integrate `ThryveAppleHealth`, along with `ThryveCore` and `ThryveCommons`.
* Use either CocoaPods or framework files for installation.
* This setup allows users to connect with Apple Health and retrieve health data automatically.

### Add HealthKit to project & configure Info.plist

To be able to build your app with integrated `ThryveAppleHealth` module you need to:

1. **Enable HealthKit**
   1. In Xcode: Navigate to *Target → Signing & Capabilities → add (+) → HealthKit*.
   2. For [Background Sync feature](https://docs.thryve.health/integrate-your-mobile-app/connect-data-sources.md) to work, ensure *Background Delivery* is enabled.

<figure><img src="https://597945514-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXHZczPNWZCe1I09YetDl%2Fuploads%2Fz3VrBoKvndIWT4jDE2vz%2Fios-healthkit-capabilities-c4537c2c.webp?alt=media&amp;token=fc24431f-626c-4235-8677-3e615d892f0f" alt=""><figcaption></figcaption></figure>

2. **Update your app's `info.plist`**

```xml
<key>NSHealthShareUsageDescription</key>
<string>This app needs permission to share your health data.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>This app needs permission to update your health data.</string>
```

{% hint style="warning" %}
Although `ThryveAppleHealth` module does not update data via HealthKit, `NSHealthUpdateUsageDescription` is required. A missing description will lead to rejection during the App Store review process.
{% endhint %}

### Garmin Companion SDK access

The `ThryveGarminCompanion` module builds on the Garmin Companion SDK, which Garmin distributes as a Swift package from its own private repository. Thryve does not redistribute it, so your project fetches it from Garmin directly. This is only required for [Garmin Companion](https://docs.thryve.health/thryve-data-sources/garmin-health-companion.md) integration.

1. **Store your Garmin credentials in the keychain**\
   Xcode needs the GitHub token to download the framework attached to the Garmin release, not only to clone the repository. Run the following in a terminal, then restart Xcode:

   ```bash
   security add-internet-password -a "x-access-token" -s "api.github.com" \
     -r "htps" -w "<garminGithubToken>" -l "Garmin Health SDK"
   ```
2. **Add your GitHub account to Xcode**\
   `Xcode > Settings… > Accounts`, add an account with the plus (+) button, choose GitHub and sign in with the account Garmin granted access to.
3. **Add the package**\
   In `File > Add Package Dependencies…`, enter the Garmin package URL, select the version matching your Thryve SDK release, and add the `Companion` library to your app target.

   ```
   https://github.com/garmin-health-sdk/ios-companion
   ```

Your `garminGithubUsername` and `garminGithubToken` are provided by Thryve on request, together with the Garmin Companion license string for your bundle ID. See [Garmin Health Companion](https://docs.thryve.health/thryve-data-sources/garmin-health-companion.md).

{% hint style="info" %}
Thryve iOS SDK 5.3.1 is built against Garmin Companion SDK `4.11.0`. Keep this version aligned with your Thryve SDK version, as on [Android](https://docs.thryve.health/pages/gd15Xn3eNpfQhy8TrHU5#the-root-build.gradle-file) with `ext.garminCompanion`.
{% endhint %}

{% hint style="warning" %}
Keep the token and the license string out of version control.
{% endhint %}

***

{% hint style="success" %}
Read [the ThryveBLE Set-up guide](https://docs.thryve.health/integrate-your-mobile-app/direct-bluetooth-device-connection) for additional information on how to set-up the ThryveBLE module
{% endhint %}

{% hint style="success" %}
Read [the ThryveShenAI Set-up guide](https://docs.thryve.health/integrate-your-mobile-app/camera-based-health-data-recording) for additional information on how to set-up the ThryveShenAI module
{% endhint %}

{% hint style="success" %}
Read [the Direct Bluetooth connection Set-up guide](https://app.gitbook.com/o/4f67njTSEa4S403XoIC0/sites/site_WRtC1/s/XHZczPNWZCe1I09YetDl/~/edit/~/changes/201/integrate-your-mobile-app/direct-bluetooth-device-connection) for additional information on how to set-up the ThryveGarminCompanion module
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thryve.health/integrate-your-mobile-app/setup-thryve-sdk/ios.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
