Skip to content

iOS SDK API Reference

Last updated: October 27, 2026

Import CybexoSDK and use CybexoCMP.shared. Call UI and consent APIs on the main thread. Normal applications should collect decisions through the SDK’s privacy screens.

API Behavior
initialize(settingsId:completion:) Loads and validates a published CYB- iOS App and its exact bundle identity. Invokes completion on success or failure.
showBanner(force:) Presents privacy choices. Pass true to reopen after a saved decision.
getConsentSnapshot() Returns current readiness, consent and delivery diagnostics.
refreshConsentState(completion:) Revalidates published settings and saved consent; optional uses remain denied while validation is pending.
retryRecipientConsent() Reapplies the latest consent to supported recipients, including a recipient configured after initialization.
retryConsentReceipts() Retries pending original records without creating a new choice.
resetConsent() Clears the local decision and applies denied values; preserves receipt history and installation identity. Use the UI’s Reject all to record a visitor withdrawal.
setTCFAdvertiserConsentMode(enabled:) Opts into/out of Google TCF advertising integration. Default off; persists independently of visitor consent. Effective only for current valid TCF consent, enabled Google delivery and applicable GDPR. Creates no visitor receipt. Host Firebase TCF ingestion is configured separately.
googleConsentModeEnabled Controls Google/Firebase forwarding. Disabling it applies denied Google values; it does not authorize attribution recipients.

CybexoCMP.consentDidChangeNotification is posted on the main thread when consent is routed and when Firebase consent application succeeds. Attribution discovery retries update the snapshot diagnostics; inspect them again after an explicit recipient retry. Read a fresh snapshot after the notification. Do not log the full snapshot in production: it can contain the TC string and App identity.

Snapshot field Meaning
initializationStatus NOT_INITIALIZED, READY, LOADING or ERROR; keep optional collection disabled unless ready.
error A diagnostic or null.
decisionMade A current, validated visitor choice exists.
framework / nativeConsentFramework Published tcf or google-consent-mode.
gdprApplies Actual resolved jurisdiction, or null while unknown.
tcString Current validated TCF string; null in Google-only mode or without a valid decision.
analyticsChoice The independent analytics choice. It is not an IAB purpose bit.
google Effective ad_storage, analytics_storage, ad_user_data, ad_personalization values, each granted or denied.
googleChoices The saved independent Boolean choices in Google-only mode.
firebaseDelivery Local Firebase consent API result. APPLIED is local API acceptance, not remote reception.
aapDelivery Separate local result for each supported attribution recipient.
receiptDelivery, receiptPendingCount Consent reporting state and number of pending originals.
tcfAdvertiserConsentModeRequested Persisted host opt-in requested through the public API.
tcfAdvertiserConsentModeEnabled Effective current TCF integration eligibility; not a visitor consent grant or proof of recipient inference.
configurationVersion Published configuration revision.

Firebase collection requires a ready configuration, a current decision, an effective analytics grant and successful local consent application. Treat null, unknown and failed states conservatively. Applying a custom host mapping over the SDK’s values can invalidate that guarantee.

TCF mode writes standard IABTCF_* metadata and purpose/vendor vectors alongside the TC string for compatible recipients. TCF 2.4 is a framework policy revision; its TC string format still uses version 2. The SDK does not encode the independent Analytics choice as an invented IAB purpose.

Google-only mode has four independent choices and produces no TC string. Switching framework or consent-relevant published settings requires revalidation; a choice from an incompatible context is not reused.

Advanced host decision APIs exist for a host that implements its own complete consent interface. They must represent an actual informed visitor action. Do not call an acceptance API automatically at startup or infer acceptance from closing a screen. Prefer the supplied UI and validate any custom interface separately.

Recipient updates use the latest decision; receipt retries preserve each original decision. An unavailable recipient does not turn into a successful delivery result. Receipt acceptance does not prove that Google, AppsFlyer, Adjust or Branch received an event.

A decision is bound to its CYB App, bundle, installation and consent configuration. The SDK uses no Keychain identity or device fingerprint. Local consent state and pending reporting must not be copied between installations. Invalid storage, a foreign CMP owner or an incompatible configuration keeps optional uses restricted.

Use CybexoWebViewBridge(webView:settingsId:ownedHTTPSOrigins:) on the main actor, before the WebView’s first load. Retain it for the view’s lifetime and call close() on dismissal. Use a dedicated user-content controller, exact HTTPS origins and one Google consent owner. Invalid App IDs, origins, already-loaded views and duplicate bridges are rejected.

Page API Behavior
cybexoNativeConsent.ready Promise for the first snapshot; inspect its readiness rather than assuming configuration has completed.
cybexoNativeConsent.getSnapshot() Promise for the latest native state.
cybexoNativeConsent.showPreferences() Reopens the same native privacy controls; the returned snapshot is not a new decision.
cybexoConsentChanged Window event whose detail is the latest state, including withdrawal.

The embedded snapshot contains ready, decisionMade, four effective google values, framework, gdprApplies and tcString. Google defaults are denied at document start and updated automatically from validated native consent. Native state is authoritative; the page cannot submit grants or import website consent. Foreign origins and child frames cannot read it.

The TCF string represents this native app, not consent for another website. The bridge does not implement a website’s __tcfapi. Embedded content must share the app’s disclosed purposes and partners. Closing the bridge denies its current document and removes its own handlers and scripts. See the setup example.