Overview
The TrustArc SDK provides a unified consent management layer for mobile and web applications. It handles remote configuration, consent state initialization, and UI presentation across Standard and IAB TCF 2.2 modes — giving developers a consistent integration surface regardless of platform.
All platforms implement the same core consent sequence. The steps below reflect how the consent flow is implemented in the app and can be used as a reference for your own integration.
What you can do
✓Initialize
the TrustArc SDK in Standard or IAB TCF 2.2 mode
✓Configure
runtime flags, overrides, and Unified Consent context before
startup
✓Present
the consent UI manually via
openCM()
✓Read
and apply returned consent values to in-app behaviour, trackers,
and IAB/TCF preferences
Prerequisites
✓TrustArc
SDK installed and linked in your project
✓A
valid TrustArc domain configured for your application
✓Unified
Consent keys and HMAC credentials (required only if using
Unified Consent)
Consent Flow Sequence
Follow the steps below in order. Each step must complete before the next begins. Steps 3 and 4 apply only in specific configurations — see the notes within each step.
1
Create or initialize the TrustArc SDK using the selected
mode:
-
Standard
— for general consent management
-
IAB TCF 2.2
— for IAB-compliant consent and TCF preference management
2
Before startup, enable the runtime flags the app requires:
- Debug logging
- GDPR detection or forced GDPR mode
-
App Tracking Transparency (ATT) prompt support
(iOS only)
- Domain, country, state, and locale overrides
3
If Unified Consent is in use, call both methods before
start():
setUnifiedConsentContext(key)
setUnifiedConsentIdentity(userId, hmac)
4
Determine the final values for domain, country, state,
and locale — including any overrides from app settings
— before calling
start().
5
Call
start()
after all configuration is applied. The SDK will:
- Download remote configuration
- Initialize consent state
- Prepare the consent UI
6
Call
openCM()
to manually present the consent UI after initialization.
This is triggered by an explicit user action in the demo
apps.
7
After initialization or UI interaction, read the returned
consent values and use them to:
- Update in-app behavior or feature flags
-
Refresh consent dashboards (category consents, Google
consents)
- Apply IAB/TCF preferences where applicable
- Enable or disable trackers
📋 Note: Steps 3 and 4 must be completed before calling start(). Calling start() before setting Unified Consent context and identity, or before finalizing locale overrides, may result in incorrect consent state.
TrustArc · SDK Consent Flow Sequence ·
www.trustarc.com