| Package | pod 'NexaGuardSDK', '~> 1.0' |
| Minimum | iOS 14 · Swift 5.10 · Xcode 16 |
| Footprint | ≈ 200 kB zipped xcframework |
platform :ios, '14.0'
target 'YourApp' do
use_frameworks!
pod 'NexaGuardSDK', '~> 1.0' # always latest 1.x
end
pod install --repo-update
open YourApp.xcworkspace
Xcode 15/16 only: SDK 1.0.1 triggers sandbox‑copy errors.
Fixed in 1.0.2 + (no action needed) — or turn Build Settings › ENABLE_USER_SCRIPT_SANDBOXING = NO.
import SwiftUI
import NexaGuardSDK
struct ContentView: View {
@State private var ready = false
var body: some View {
VStack {
Button("Show CMP") {
NexaGuardCMP.shared.showBanner(force: true)
}
}
.onAppear {
guard !ready else { return }
NexaGuardCMP.shared.initialize(settingsId: "YOUR_SETTINGS_ID") {
print("CMP ready") // ← callback fires once
}
ready = true
}
}
}
extension UIApplication {
static var topVC: UIViewController? {
var vc = UIApplication.shared.connectedScenes
.compactMap { ($0 as? UIWindowScene)?.keyWindow }
.first?.rootViewController
while let presented = vc?.presentedViewController { vc = presented }
return vc
}
}
| Call | Purpose |
|---|---|
initialize(settingsId) | Loads branding & GVL; stores TC string. |
showBanner(force) | Forces banner even when consent stored. |
acceptAllSelections() / rejectAllSelections() | Second‑layer shortcuts. |
applyCustomSelections(pid, vid) | Persist your own matrix. |
getTCString() | Retrieve stored TC string at runtime. |
NexaGuard CMP fully supports Google Consent Mode.
Basic configuration
Advanced configuration
Note: Consent Mode is a technical solution for tag management and measurement.
It does not by itself ensure legal compliance (such as with GDPR).
For more details and implementation options, see:
Consent Mode – Basic
Consent Mode – Advanced
Full docs ➜ https://developer.nexaguard.com
© 2025 NexaGuard Inc. All rights reserved.
