tvOS SDK: Setup & Initialisation
Overview
Section titled “Overview”The Secure Privacy Consent Management SDK provides tvOS developers with an easy way to manage user consent within their applications. By integrating this SDK, you can ensure compliance with privacy regulations while giving users control over their data preferences.
Getting Started
Section titled “Getting Started”Obtain Your Application ID
Section titled “Obtain Your Application ID”To use the Secure Privacy Consent Management SDK, you need an Application ID. If you don’t have an account yet, sign up for a free trial at Secure Privacy.
To find your Application ID, sign in to the Secure Privacy Platform, go to TV apps, and open your app. The Installation tab shows it under Your Application ID, ready to copy.
Installation
Section titled “Installation”To begin using the Secure Privacy SDK for tvOS, you can integrate it using XCFramework or Swift Package Manager (SPM).
Option 1: Using XCFramework
Section titled “Option 1: Using XCFramework”- Download the SPTVConsent.xcframework.
- Open your Xcode project.
- Drag and drop
SPTVConsent.xcframeworkinto your project. - Go to Targets → Frameworks, Libraries, and Embedded Content.
- Ensure
SPTVConsent.xcframeworkis listed, and set to Embed & Sign.
Option 2: Using Swift Package Manager (SPM)
Section titled “Option 2: Using Swift Package Manager (SPM)”- In Xcode, go to: File → Add Packages
- Enter the URL:
https://github.com/secureprivacy/tvos-sdk-spm.git- Set the version requirement to: Exact Version → 0.1.8-beta
- Add the
SPTVConsentlibrary to your target.
Initialisation
Section titled “Initialisation”To initialise the SDK, call the following method in your app’s entry point (typically in AppDelegate.swift or SceneDelegate.swift):
import SPTVConsent
let result = await SPConsentEngineFactory.initialise( key: SPAuthKey( applicationId: "YOUR_APPLICATION_ID", secondaryApplicationId: "YOUR_SECONDARY_APPLICATION_ID" ))let spConsentEngine = result.dataThis will set up the SDK and enable access to its features.
⚠️ The returned
spConsentEngineis session-bound. If you callSPConsentEngineFactory.clearSession(), runSPConsentEngineFactory.initialise(...)again and use the fresh instance before further SDK calls.
Asset Configuration Note
Section titled “Asset Configuration Note”When you configure your tvOS app in the Secure Privacy Platform, use a PNG or JPG image for the banner logo, because the SDK does not support SVG.
