Download and Import the SDK
Download Options
- Download from Cocoapods (SDK framework only, no demo app)
- Download from Swift Package Manager (SDK framework only, no demo app)
- Download from OneTrust Tenant (SDK framework and demo app)
Download from Cocoapods
Cocoapods version
OneTrust recommends keeping your Cocoapods version within the last 2 versions. If you experience any issues downloading and running the Cocoapods OneTrust framework, please check or upgrade this version first.
- Add the pod reference to your podfile:
// replace the version with your desired version
pod 'OneTrust-CMP-XCFramework', '~> 202505.1.0.0'
pod 'OneTrust-CMP-tvOS-XCFramework', '~> 202505.1.0.0'
- Run pod install in your project directory.
- Open App.xcworkspace and build.
Download from Swift Package Manager
Notice
- If the application target has previously been using the
.framework
or.xcframework
file, remove/delete all references of it from target's build or general settings before adopting the Swift Package
- Delete the existing
OTPublishersHeadlessSDK.framework
orOTPublishersHeadlessSDK.xcframework
from the application target- Remove
OTPublishersHeadlessSDK.framework
orOTPublishersHeadlessSDK.xcframework
from 'Embedded Frameworks' and 'Link Binary With Libraries' under the application target's 'Build Phases' tab if not automatically removed
- Open the application project or workspace.
- Select File > Add Package Dependencies
- Enter the URL for the corresponding Swift package you want to integrate and click enter.
- If you want to integrate the iOS OT SDK, enter the Github public URL: https://github.com/Zentrust/OTPublishersHeadlessSDK.
- If you want to integrate the tvOS OT SDK, enter the Github public URL: https://github.com/Zentrust/OTPublishersHeadlessSDKtvOS.
- Choose the Dependency Rule that is appropriate for your project. The package version you install should usually match the SDK version that's been published in the OneTrust tenant/admin console
- Choose the Project to add the package to
- Click Add Package
All the steps mentioned above are only required the first time the application target is being linked with the OT SDK Swift Package. After this is done and on subsequent releases, the application can directly fetch the latest OT SDK package with the following path: File > Packages > Update to Latest Package Version.
Download from OneTrust Tenant/Admin Console
- Log in to your OneTrust tenant/admin console
- Head to Mobile App Consent > SDKs > Your app > SDK > Select the framework you'd like to download (Native, Unity, MAUI)
- Select the SDK version to download under
Select API Version
- Download SDK

- Unzip the file and add the iOS or tvOS
.xcframework
file into your Xcode project
Folder Structure | File/Folder Name | Description |
---|---|---|
OTPublishersHeadlessSDK-XCFramework > XCode_15.2 > OTPublishersHeadlessSDK-15.2 > OTPublishersHeadlessSDK.xcframework | OTPublishersHeadlessSDK.xcframework | XCFramework ensures forward compatibility with versions after XCode 11.1. This also automatically removes the simulator architectures when users are ready for production without having to manually switch between "testing" and "release ready" frameworks |
OTPublishersHeadlessSDK-XCFramework > XCode_15.2 > OTPublishersHeadlessSDKtvOS-15.2 > OTPublishersHeadlessSDKtvOS.xcframework | OTPublishersHeadlessSDKtvOS.xcframework | XCFramework ensures forward compatibility with versions after XCode 11.1. This also automatically removes the simulator architectures when users are ready for production without having to manually switch between "testing" and "release ready" frameworks |
Once added to your Xcode project, verify that:
- OTPublishersHeadlessSDK.xcframework is added to Frameworks, Libraries, and Embedded Contents under target's General tab.
- OTPublishersHeadlessSDK.xcframework is Embedded and Signed
Import the SDK
After adding the SDK to your application, you must import it to begin accessing its methods.
iOS
import OTPublishersHeadlessSDK
tvOS
import OTPublishersHeadlessSDKtvOS
Why is the iOS and tvOS SDK separate?
The tvOS SDK still uses iOS's `OTPublishersHeadlessSDK
as the class and so the business logic is essentially identical. This makes sharing and reusing code between iOS and tvOS easier. The library was bifurcated into two frameworks in order to keep the architectures and view controllers separate, otherwise the size would be too large to deploy through package managers.
Why is XCFramework recommended?
We recommend XCframework because Apple recommends it. They introduced the feature in WWDC19 and XCode 11.
For more information, watch the Tech Talk from WWDC19.
Updated 1 day ago