CybexoSDK iOS Setup
Last updated: October 27, 2026
CYBEXO iOS SDK 2.0.3 supports published CYB- Apps, IAB TCF 2.4 choices and a separate Google consent dialog. The SDK records the visitor’s decision and applies supported recipient consent APIs. Your app must configure its actual recipients and control their startup and optional events.
Version 2.0.3 restores the existing optional Google TCF integration API: true/false are honored and the requested setting survives relaunch independently of visitor consent. Direct delivery remains the default. The native privacy screens, saved-choice formats and app-owned WebView bridge remain compatible with 2.0.2.
Install
Section titled “Install”platform :ios, '15.0'
target 'YourApp' do use_frameworks! pod 'CybexoSDK', '2.0.3'endRun pod install --repo-update, then open the generated workspace. The public framework is CybexoSDK; its entrypoint is CybexoCMP. Version 2.0.3 requires iOS 15 or later. Recompile your app when upgrading from 1.x.
Optional Google TCF integration
Section titled “Optional Google TCF integration”The default integration uses direct four-value Google updates. To also allow Google to read the app’s TCF advertising choices, call the existing public option on the main thread before initializing CYBEXO:
CybexoCMP.shared.setTCFAdvertiserConsentMode(enabled: true)CybexoCMP.shared.initialize(settingsId: "YOUR_CYB_APP_ID")Set GOOGLE_ANALYTICS_TCF_DATA_ENABLED to true in the host Info.plist (or omit that key to retain Firebase’s normal TCF ingestion). Keep collection disabled and all four restrictive startup defaults shown below. The SDK cannot override a host setting that disables Google’s TCF reader.
The requested option persists for this host installation separately from visitor consent; passing false opts out again. The effective IABTCF_EnableAdvertiserConsentMode flag is 1 only with a current valid CYBEXO TCF decision, Google delivery enabled and GDPR applicable. It stays 0 while loading, without a decision, in Google-only mode, outside GDPR, after reset or when Google delivery is disabled. Another CMP’s IAB preferences are preserved. A rejected TC string can legitimately have flag 1: it permits interpretation of the rejection and grants no consent.
Direct updates continue, including the independent Analytics choice and Google vendor veto. The snapshot distinguishes tcfAdvertiserConsentModeRequested from tcfAdvertiserConsentModeEnabled. Changing this host option does not create a visitor decision or consent receipt. Flag1 alone does not prove inference or remote reception; verify actual recipient behavior with your Firebase version and host configuration.
Register and publish your App
Section titled “Register and publish your App”Create an iOS App in the CYBEXO Dashboard, using available App CMP capacity. Register the exact, case-sensitive bundle identifier used by your application. Use its CYB- App ID; legacy App IDs are rejected.
Choose IAB TCF or Google consent choices, configure the actual purposes and partners you use, then save and publish. Changing the framework does not change the visitor’s jurisdiction. Keep Google Consent Mode enabled when you want Firebase consent delivery. The SDK uses published settings; a saved draft does not change the live app.
Provide your privacy policy and disclose your actual analytics and attribution recipients. Keep a visible way to reopen preferences throughout the app.
Start with optional collection disabled
Section titled “Start with optional collection disabled”Set these Boolean values to NO in the host app’s Info.plist before Firebase initializes:
<key>FIREBASE_ANALYTICS_COLLECTION_ENABLED</key><false/><key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_STORAGE</key><false/><key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_ANALYTICS_STORAGE</key><false/><key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_USER_DATA</key><false/><key>GOOGLE_ANALYTICS_DEFAULT_ALLOW_AD_PERSONALIZATION_SIGNALS</key><false/><key>GOOGLE_ANALYTICS_TCF_DATA_ENABLED</key><false/>Before any FirebaseApp.configure() call on every launch, reapply denied values and keep collection disabled:
import FirebaseAnalytics
Analytics.setAnalyticsCollectionEnabled(false)Analytics.setConsent([ .adStorage: .denied, .analyticsStorage: .denied, .adUserData: .denied, .adPersonalization: .denied])Configure Firebase normally after applying these fixed restrictive startup values, with optional collection disabled, then initialize CYBEXO. Firebase persists runtime settings across launches, so the plist alone does not replace startup gating. CYBEXO detects Firebase and automatically applies changing consent values; do not add a snapshot-to-Firebase value relay. If Firebase becomes available later, call retryRecipientConsent() once after configuring it. Read a fresh snapshot and enable collection only through the gate below; avoid a retry loop inside the observer.
Use Firebase’s FirebaseAnalyticsCore product when your app does not need advertising identifier support. App Tracking Transparency is separate from TCF and Google consent: CYBEXO does not obtain Apple’s tracking permission for your app. Do not interpret a CMP choice as ATT permission.
See Google’s iOS collection guidance and Google’s app consent guide.
Initialize once and observe readiness
Section titled “Initialize once and observe readiness”Call on the main thread after the host interface is available:
import CybexoSDK
CybexoCMP.shared.initialize(settingsId: "YOUR_CYB_APP_ID") { let state = CybexoCMP.shared.getConsentSnapshot() guard state["initializationStatus"] as? String == "READY" else { // Keep optional collection disabled. Display a retry option if needed. return }}The completion callback also runs on failure; inspect readiness rather than treating callback invocation as successful initialization. First use presents the appropriate consent screen. A saved choice is restored only after validating its App, bundle, installation, age and current consent configuration.
Observe CybexoCMP.consentDidChangeNotification on the main queue. Read getConsentSnapshot() after each notification. Enable optional Analytics collection only when the configuration is ready, a decision exists, google.analytics_storage is granted, and Firebase delivery is APPLIED. Stop collection immediately when those conditions stop holding. Do not overwrite CYBEXO’s four consent values with another mapper.
let observer = NotificationCenter.default.addObserver( forName: CybexoCMP.consentDidChangeNotification, object: nil, queue: .main) { _ in let state = CybexoCMP.shared.getConsentSnapshot() // Update your collection controls and privacy status from this snapshot.}Retain the observer token and remove it when its owner is disposed. After configuring a recipient later, call retryRecipientConsent() before starting its first session.
Reopen, retry and withdraw
Section titled “Reopen, retry and withdraw”CybexoCMP.shared.showBanner(force: true)CybexoCMP.shared.refreshConsentState()CybexoCMP.shared.retryRecipientConsent()CybexoCMP.shared.retryConsentReceipts()Use the privacy screen for accept, reject and individual choices. Changes in preferences remain pending until saved. Closing without saving preserves the last committed decision. Withdrawing through Reject all creates a new decision; resetConsent() clears the local decision and applies denied signals, but does not represent a visitor’s rejection action or erase historical receipts.
Offline consent records retain their original event identifiers, timestamp, predecessor and decision. A retry does not create a new visitor choice. Local installation identity and the pending receipt store are excluded from backup; a restored or foreign installation must establish its own decision.
Release checks
Section titled “Release checks”Test first use, rejection, acceptance, individual purpose/vendor/legitimate-interest choices, independent analytics, withdrawal, restart, configuration change, failed loading and offline receipt retry. Verify small screens, large text and the privacy re-entry path. Decode actual TCF output with an independent decoder and inspect actual recipient behavior.
A stored choice, accepted recipient API call, recorded consent receipt and event visible in a provider console are different checks. Simulator results do not establish physical-device behavior or Google/IAB certification. Validate the final application and provider configuration you will submit.
The SDK includes a privacy manifest describing its own storage and consent reporting. Your app’s privacy disclosures must also cover its recipients and all other collected data. If rolling back, keep collection restricted while validating the replacement; removing the CMP must never leave previously granted optional SDKs running without consent controls.
App-owned embedded WebViews
Section titled “App-owned embedded WebViews”Version 2.0.2 adds CybexoWebViewBridge. Attach it before the first load, retain it with the view, and call close() when the view is finished. Use a dedicated WKUserContentController and exact HTTPS origins whose content and scripts you control.
let webView = WKWebView(frame: .zero)let bridge = try CybexoWebViewBridge( webView: webView, settingsId: "YOUR_CYB_APP_ID", ownedHTTPSOrigins: ["https://app.example.com"])webView.load(URLRequest(url: URL(string: "https://app.example.com/embedded")!))// Retain bridge for this view's lifetime; later call bridge.close().The bridge sets all four Google defaults to denied at document start, then updates them from the app’s validated consent. It stays denied while native configuration or a current decision is unavailable. It shares only this app’s choice with its own main-frame content; it does not grant consent to unrelated websites, other apps or child frames. Origin paths, wildcards and HTTP origins are rejected.
In the embedded page, await window.cybexoNativeConsent.ready returns the first native snapshot (which may still be loading). Use getSnapshot() for a fresh snapshot and listen for cybexoConsentChanged for subsequent changes. Require ready, decisionMade and the relevant granted value before starting optional processing. The page can call showPreferences() to reopen the same native privacy controls; it cannot directly change native consent through JavaScript.
function applyConsent(state) { const analyticsAllowed = state.ready && state.decisionMade && state.google.analytics_storage === 'granted'; // Enable or disable your own optional processing using this state.}window.addEventListener('cybexoConsentChanged', e => applyConsent(e.detail));window.cybexoNativeConsent.ready.then(applyConsent);document.querySelector('#privacy-choices').onclick = () => window.cybexoNativeConsent.showPreferences();Use only one Google consent owner in the view. Do not install a second web CMP or override its defaults. Google tags, if present, use the bridge’s normal dataLayer consent commands; other embedded integrations should consume the snapshot. tcString is the native app’s current TCF string, not a separate website decision or a replacement for a website’s __tcfapi. Embedded content must have the same disclosed purposes and partners as the app. Host apps remain responsible for restricting navigation and gating non-Google processing.