NexaGuard
    NexaGuard
    • NexaGuard Onboarding
    • iOS Setup
    • Android Setup
    • Web Setup
    • Webflow and Wix
    • WordPress Integration
    • Drupal Integration
    • Shopify Integration
    • LICENSE

    iOS Setup

    NexaGuard CMP SDK – iOS Setup

    Packagepod 'NexaGuardSDK', '~> 1.0'
    MinimumiOS 14 · Swift 5.10 · Xcode 16
    Footprint≈ 200 kB zipped xcframework

    1 Install via CocoaPods

    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.


    2 Show the banner (SwiftUI)

    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
            }
        }
    }
    

    UIKit helper (top view controller)

    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
        }
    }
    

    3 API cheat‑sheet

    CallPurpose
    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.

    4 Consent Mode: Basic vs. Advanced

    NexaGuard CMP fully supports Google Consent Mode.

    What are the options?

    • Basic configuration

      • Google tags are blocked until the user provides consent.
      • No analytics, ads, or personalization tags will fire before the user’s decision.
      • This approach is privacy-focused and is often recommended for jurisdictions with strict consent requirements.
    • Advanced configuration

      • Google tags fire immediately on page load, even before the user provides consent.
      • Tags collect only limited, anonymized (cookieless) signals until the user makes a choice.
      • Once a consent decision is made, tag behavior updates automatically.

    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

    How to select your configuration

    • By default, NexaGuard CMP uses the “Basic” (blocking) mode.
    • To switch to Advanced mode (allow tags before consent), update your configuration [via dashboard setting, script parameter, or by contacting support].
    • You can also customize consent mode behavior per region in your NexaGuard dashboard (feature coming soon).

    Full docs ➜ https://developer.nexaguard.com


    © 2025 NexaGuard Inc. All rights reserved.

    Previous
    NexaGuard Onboarding
    Next
    Android Setup