For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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 provided in the Thryve iOS Sample App 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.

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

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

ThryveCommons

ThryveAppleHealth

ThryveShenAI

ShenaiSDK

Sample App

ThryveObservability

ThryveBLE

ThryveGarminCompanion

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.

  1. 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.

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),

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.

    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.

  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.

    2. Click Add Package to confirm.

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.

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, such as 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.

  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.

The PrivacyInfo.xcprivacy plist file should look similar to this sample

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 to work, ensure Background Delivery is enabled.

  1. Update your app's info.plist

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 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:

  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.

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.

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 with ext.garminCompanion.


Last updated