Skip to main content

Introduction

The Unified Consent iOS SDK provides a comprehensive solution for managing user privacy choices and consent. Here's how to integrate and launch the UI in your iOS application:

Basic Integration

import UIKit
import UnifiedConsentSDK

class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

UnifiedConsentSDKSwift.shared.initWith(
view: self,
configId: Environment.current.configId,
customerId: Environment.current.customerId
)
}
}
note

The configId and customerId parameters are mandatory and must match your configuration on the Osano website.

Configuration Options

Pre-verified Email

If you already have a verified email address for the user, you can set it before initialization:

UnifiedConsentSDKSwift.shared.verifiedEmailAddress = "user@example.com"

Verbose logging

UnifiedConsentSDKSwift.shared.verbose = true

UI Customization

The SDK supports extensive UI customization through your Osano configuration:

  • Text colors and fonts for headings and paragraphs
  • Button colors and styles
  • Page background colors
  • Custom text for various UI elements

Delegate Methods

Implement the UnifiedConsentSDKSwiftDelegate to handle various events:

protocol UnifiedConsentSDKSwiftDelegate: NSObjectProtocol {
func didCancelUnifiedConsentSDK()
func didSubmitUnifiedConsentSDK(selectedItemAt index: Int, action:[[String:Any]])
func didUnifiedConsentSDKPrivacyPolicy()
}