Download 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 (includes Demo App)
Download from Cocoapods
Recommendation: The OneTrust team recommends keeping your Cocoapods version within the last 2 versions. If you experience any issue downloading and running the Cocoapods frameworks, please look to check or upgrade this version first.
-
Navigate to Cocoapods and search
OneTrust-CMP
to identify the SDK framework you wish to download. -
Add the pod reference to your podfile:
// replace version # with latest SDK version
pod 'OneTrust-CMP-XCFramework', '~> 202209.1.0.0'
pod 'OneTrust-CMP-tvOS-XCFramework', '~> 202209.1.0.0'
- Run
pod install
in your project directory. - Open
App.xcworkspace
and build.
Download from Swift Package Manager
- If the application target had been using .framework or .xcframework, delete any existence of .framework/.xcframework and all of its references from Target's Build or General Settings before adopting Swift Package.
- Delete the existing OTPublishersHeadlessSDK.framework / OTPublishersHeadlessSDK.xcframework from Application Target.
- Remove OTPublishersHeadlessSDK.framework / OTPublishersHeadlessSDK.xcframework from "Embedded Frameworks" and to "Link Binary With Libraries" under Application Target's Build Phases Tab if not automatically removed.
- Open the Application project or workspace.
- Select File > Add Packages..., which opens the Swift Packages screen.
- Search for Swift Packages in the Swift Packages modal.
- Enter the URL for the corresponding Swift package you want to integrate and press
ENTER
.
- If you want to integrate the iOS OT SDK via SPM, enter the Github public URL: <<https://github.com/Zentrust/OTPublishersHeadlessSDK>> for iOS.
- If you want to integrate the tvOS OT SDK via SPM, enter the Github public URL: <<https://github.com/Zentrust/OTPublishersHeadlessSDKtvOS>> for tvOS.
- Select the Swift package in the middle section of the modal. On the right side, you will be prompted to decide on the Dependency Rule and the Project.
- Choose the Dependency Rule that is appropriate for your project.
- Choose the Project to which your application target belongs.
- Click on the bottom-right of the pop-up to see that the Add Package button is now enabled.
- Click on the button to begin resolving the Swift package. While resolving the Swift package, you will be prompted with the Choose Package Product modal, where you will need to select the Target to which the Swift Package Product should be added to.
- Select the appropriate Target. Once the target as been selected, the Swift Package Product will be added to that Target.
Note: All the above-mentioned steps are only required to be done once whenever the Application target is being linked with OT SDK Swift Package. After this is done, during the next releases, the application can directly fetch the latest OT SDK Swift Package by going to File -> Packages -> Update to Latest Package Version.
Download from OneTrust Tenant
- Navigate to Mobile App Compliance > SDKs
- Select the Application from the list
- Select the SDK tab
- Select your SDK Implementation e.g. Native SDK
- Select Download SDK
What's in the Download Package?
Folder Structure | File/Folder Name | Description |
---|---|---|
OTPublishersNativeApp | OTPublishersNativeApp.xcodeproj | As of the OneTrust 6.3 release, the default .framework is XCode 11.5. In OneTrust 6.4, this will be changed to XCFramework as it is a more flexible framework and better suited for adoption. |
BitcodeEnabled | OTPublishersHeadlessSDK.framework | Use when bitcodeEnabled "release ready" framework is necessary for XCode 11.5 |
BitcodeEnabled-Test | OTPublishersHeadlessSDK.framework | Use when bitcodeEnabled "testing" framework is necessary for XCode 11.5 |
BitcodeDisabled | OTPublishersHeadlessSDK.framework | Use when bitcodeDisabled "release ready" framework is necessary for XCode 11.5 |
OTPublishersHeadlessSDK-XCFramework | OTPublishersHeadlessSDK.xcframework | Use this as often as possible as the 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. |
Why is XCFramework recommended?
We recommend XCframework because Apple recommends it. They introduced the XCFramework feature in WWDC19 and XCode 11.
For more information, consider watching the Tech Talk from WWDC19.
Updated about 1 year ago