Didomi - Developers documentation
  • Introduction
  • SDKs
    • Introduction
    • Web SDK
      • Getting started
      • Tags and vendors management
        • Tags management
          • Events & Variables
            • Deprecated
            • Custom events
          • Tag managers
            • Adobe Launch/DTM
            • Eulerian
            • Google Tag Manager
              • Configure the Didomi / GTM integration
              • Didomi's GTM template
            • Tealium
            • Other tag managers
        • Custom Didomi <script> tags
        • Third-party integrations
          • Google Ad Manager / AdSense
            • GDPR via Non-Personalized Ads
              • Share consent and load/refresh ads
              • Share consent without loading or refreshing ads
            • US states laws
          • Google Consent Mode V2
          • Kameleoon
          • Piano Analytics (AT Internet)
          • Prebid
            • GDPR via IAB TCF
            • US states laws
          • Salesforce DMP (Krux)
        • IAB frameworks
        • Programmatic API
      • Configuration
        • Bots (SEO & Performance tools)
        • Configuration by URL
        • Cookies and storage
        • Custom domains for events
        • Notice
          • Behavior
          • Interactions
          • Look and feel
        • Preferences
        • Theme
      • AB tests
      • Custom domain
        • Domain delegation
        • Reverse proxy
      • Share consents between domains
      • Share consents across devices
      • Pass user choices in query string
      • Serve Didomi assets from your domain
      • Reference
        • API
          • Deprecated
        • Events
      • Performance
      • Versions
    • Mobile and TV SDKs
      • Android and Android TV
        • Setup
        • Logging
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • iOS and tvOS
        • Setup
        • Logging
        • App Tracking Transparency (iOS 14.5+)
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • Unity
        • Setup
        • Reference
        • Versions
        • Troubleshooting
      • React Native
        • Setup
        • Reference
          • Deprecated
        • Versions
      • Flutter
        • Setup
        • Reference
        • Versions
      • Consent notice
        • Getting started
        • Customize the notice
        • Customize the preferences popup
        • Customize the theme & UI
        • Load notice by ID
      • Third-party SDKs
      • Share consents across devices
      • Share consent with WebViews
      • Google Consent Mode v2
      • FAQ
    • AMP SDK
      • Blocking Behaviors
        • Load immediately on page load
        • Load only after consent (positive or negative)
        • Load only after positive consent
      • Consent status for vendors
    • Help & Support
  • API
    • Introduction
      • Authentication
      • Errors
      • Pagination
      • Filters
      • Caching
      • Rate limiting
      • Quotas
      • Translations
    • Data Manager
      • Regulations
      • Configuration Tree
      • Purposes
        • Purposes & Vendors Numerical IDs
      • Preferences Library
      • User Rights
    • Widgets
      • Consent notices
        • Notices
        • Configurations
        • Multi-Regulation Configurations
          • Migration of Existing Notices and API Updates
        • Deployments
        • Tutorials
          • Create and publish a consent notice
          • Create and publish a multi-regulation consent notice
      • Privacy widgets
        • Create a widget
        • Retrieve widgets
        • Edit a widget
          • Content & Design
            • Themes & Shapes
            • Components
              • auth
              • dsar_form
              • footer
              • header
              • preference
              • preference_value
              • save
              • section
              • sections
            • Options
          • Purposes & preferences
          • Settings
        • Deploy a Widget
          • Use your own subdomain
          • Use your own domain
          • Implement an embeddable widget on your website
        • Authentication
          • Manage authentication providers
          • Authenticate your end-user
        • Archive a widget
        • Headless widgets
          • Public Methods
          • Custom elements
          • Custom events
          • Event listeners
        • Tutorial
          • Launch a Preference Center from a mobile app
    • Compliance Reports
      • Properties
      • Reports
      • CSV format reference
      • Websites
    • Consents and Preferences
      • Events
        • Generate IAB TCF consent string
      • Links
      • Proofs
      • Tokens
      • Secrets
      • Users
      • Tutorial
        • Collect and operate data
    • Privacy Requests
      • Requests
      • Notes
      • Links
      • Emails
  • Integrations
    • Introduction
      • Quotas
    • Generic integrations
      • Batch export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
        • Exported data
          • Notices consents
        • Logs
      • Webhooks
      • Batch import
      • Analytics export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
    • Third-party apps
      • CMP integrations
        • Didomi-mParticle integration for your CMP
        • Deploy Didomi’s SDK for your Adobe Commerce website
      • Preference Management Platform integrations
        • Actito
        • Adobe Campaign Classic
        • Adobe Experience Cloud
        • Adobe Marketo Engage
        • Adobe Source Connector
        • Braze
        • Dotdigital
        • Hubspot
        • Mailchimp
        • Microsoft Dynamics 365
        • Salesforce Marketing Cloud
        • Salesforce Sales & Service Cloud
        • Selligent
        • Brevo (ex Sendinblue)
    • Tutorials
      • Configure a HTTP webhook
      • Configure a batch export
      • Configure an analytics export
    • Emailing
      • Configurations
        • Actito Email
        • Actito SMS
        • Adobe Campaign Classic
        • Adobe Campaign Standard
      • Emails
        • Templates
        • Manage your templates
Powered by GitBook
On this page
  • IAB Vendor
  • Non-IAB Vendor
  • Vendor with custom API
  • Vendor without a custom API
  • Google Additional Consent Mode
  1. SDKs
  2. Mobile and TV SDKs

Third-party SDKs

PreviousLoad notice by IDNextShare consents across devices

Last updated 5 months ago

IAB Vendor

Transparency and Consent Framework (TCF)

The Didomi SDK shares the user consent status with vendors through the .

For vendors that support the framework (), the only thing you have to do is declare them in the list of vendors that your app uses (see the section for more information on how to do that) and they will adapt their data processing to respect the user consent.

Global Privacy Platform (GPP)

Please note: to use GPP on Android, the minimum required Android API version is 21. Make sure your app support version 21 or above.

The string encapsulates user privacy preferences across multiple jurisdictions and frameworks. To learn more about Didomi's GPP integration read our .

The pre-parsed data as well as the full GPP string are generated and stored by Didomi Mobile SDK in your app storage in (iOS) or (Android).

Key name
Data type
Description

IABGPP_HDR_Version

String

GPP Version

IABGPP_HDR_Sections

String

List of Section IDs

IABGPP_HDR_GppString

String

Full consent string in its encoded form

IABGPP_GppSID

String

Section ID(s) considered to be in force. Multiple IDs are separated by underscore, e.g. “2_3”

IABGPP_[SectionID]_String

String

String representation of each section. E.g. IAB TCF EU v2 String will be found at IABGPP_2_String

pre-parsed data from the applicable string section

String or integer

Non-IAB Vendor

For other vendors, that do not implement the IAB specification, you will need to share the consent status with their SDK if they have an API to do so or prevent their SDK from loading until the user has given consent for the vendor and its purposes. This has to be done manually for every vendor.

Vendor with custom API

Some vendors will offer a custom (non-IAB) API to tell their SDK what the user consent status is. In that case, check the user consent status for the vendor and pass it to the SDK:

public void loadVendor() {
    boolean vendorHasConsent = Didomi.getInstance().getUserStatus()
        .getVendors().getGlobalConsent().getEnabled().contains("vendor-id");

    if (vendorHasConsent) {
        // We have consent for the vendor
        // Initialize the vendor SDK and pass the positive consent status
    } else {
        // We do not have consent information yet
        // Wait until we get the user information
        Didomi.getInstance().addEventListener(new EventListener() {
            @Override
            public void consentChanged(@NotNull ConsentChangedEvent event) {
                loadVendor();
                Didomi.getInstance().removeEventListener(this);
            }
        });
    }
}

Didomi.getInstance().onReady(() -> {
    loadVendor();
});
fun loadVendor() {
    val didomi = Didomi.getInstance()
    val vendorHasConsent = didomi.userStatus
        .vendors.globalConsent.enabled.contains("vendor-id")

    if (vendorHasConsent) {
        // We have consent for the vendor
        // Initialize the vendor SDK and pass the positive consent status
    } else {
        // We do not have consent information yet
        // Wait until we get the user information
        didomi.addEventListener(object : EventListener() {
            override fun consentChanged(event: ConsentChangedEvent) {
                loadVendor()
                didomi.removeEventListener(this)
            }
        })
    }
}

Didomi.getInstance().onReady { loadVendor() }
func loadVendor() {
    let didomi: Didomi = Didomi.shared
    let vendorHasConsent = didomi.getUserStatus().vendors.globalConsent.enabled.contains("vendor-id")
    
    if vendorHasConsent {
        // We have consent for the vendor
        // Initialize the vendor SDK and pass the positive consent status
    } else {
        let didomiEventListener = EventListener()
        didomiEventListener.onConsentChanged = { [unowned self] event in
            self.loadVendor()
            didomi.removeEventListener(listener: didomiEventListener)
        }
        didomi.addEventListener(listener: didomiEventListener)
    }
}

Didomi.shared.onReady {
    self.loadVendor()
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    Didomi *didomi = [Didomi shared];
    [didomi onReadyWithCallback:^{
        [self loadVendor];
    }];
}

- (void)loadVendor {
    Didomi *didomi = [Didomi shared];
    NSSet<NSString *>* enabledVendorsConsent = [[[[didomi getUserStatus] vendors] globalConsent] enabled];
    
    if ([enabledVendorsConsent containsObject:@"vendor-id"]) {
        // We have consent for the vendor
        // Initialize the vendor SDK and pass the positive consent status
    } else {
        DDMEventListener *didomiEventListener = [[DDMEventListener alloc] init];
        __weak DDMEventListener *wDidomiEventListener = didomiEventListener;
        [didomiEventListener setOnConsentChanged:^(enum DDMEventType event) {
            [self loadVendor];
            [didomi removeEventListenerWithListener: wDidomiEventListener];
        }];
        [didomi addEventListenerWithListener:didomiEventListener];
    }
}
public void LoadVendor()
{
    ISet<String> enabledVendors = Didomi.GetInstance().GetUserStatus().GetVendors().GetGlobalConsent().GetEnabled();
    bool vendorHasConsent = enabledVendors.Contains("vendor-id");

    if (vendorHasConsent)
    {
        // We have consent for the vendor
        // Initialize the vendor SDK and pass the positive consent status
    }
    else
    {
        // We do not have consent information yet
        // Wait until we get the user information
        DidomiEventListener eventListener = new DidomiEventListener();
        eventListener.ConsentChanged += EventListener_ConsentChanged;

        Didomi.GetInstance().AddEventListener(eventListener);
    }
}

private void EventListener_ConsentChanged(object sender, ConsentChangedEvent e)
{
    LoadVendor();
}

Didomi.GetInstance().OnReady( () =>  LoadVendor() );
async function loadVendor() {
  let vendorHasConsent = (await Didomi.getUserStatus()).vendors.global_consent.enabled.includes("vendor-id");
  if (vendorHasConsent) {
    // We have consent for the vendor
    // Initialize the vendor SDK and pass the positive consent status
  } else {
    let consentListener = (data: any) => {
      loadVendor();
      Didomi.removeEventListener(DidomiEventType.CONSENT_CHANGED, consentListener);
    };
    Didomi.addEventListener(DidomiEventType.CONSENT_CHANGED, consentListener);
  }
}

Didomi.onReady().then(() => {
  loadVendor();
});
void requestLoadVendor() {
  final consentListener = EventListener();
  consentListener.onConsentChanged = () {
    loadVendorIfConsent(consentListener);
    consentListener.onConsentChanged = () {};
  };
  DidomiSdk.addEventListener(consentListener);

  loadVendorIfConsent(consentListener);
}

void loadVendorIfConsent(EventListener consentListener) async {
  final hasVendorStatus = (await DidomiSdk.userStatus).vendors?.globalConsent?.enabled?.contains("vendor-id") == true;
  if (hasVendorStatus) {
    // We have consent for the vendor
    // Initialize the vendor SDK and pass the positive consent status
    consentListener.onConsentChanged = () {};
  }
}

DidomiSdk.onReady(() => { requestLoadVendor() });

Vendor without a custom API

For vendors that do not offer a custom API to share the user consent status, your only option is to not load their SDK until the user has given consent. Use the following snippet of code to get started:

public void loadVendor() {
    boolean vendorHasConsent = Didomi.getInstance().getUserStatus()
        .getVendors().getGlobalConsent().getEnabled().contains("vendor-id");

    if (vendorHasConsent) {
        // We have consent for the vendor
        // Initialize the vendor SDK
    } else {
        // We do not have consent information yet
        // Wait until we get the user information
        Didomi.getInstance().addEventListener(new EventListener() {
            @Override
            public void consentChanged(@NotNull ConsentChangedEvent event) {
                loadVendor();
                Didomi.getInstance().removeEventListener(this);
            }
        });
    }
}

Didomi.getInstance().onReady(() -> {
    loadVendor();
});
fun loadVendor() {
    val didomi = Didomi.getInstance()
    val vendorHasConsent = didomi.userStatus
        .vendors.globalConsent.enabled.contains("vendor-id")

    if (vendorHasConsent) {
        // We have consent for the vendor
        // Initialize the vendor SDK
    } else {
        // We do not have consent information yet
        // Wait until we get the user information
        didomi.addEventListener(object : EventListener() {
            override fun consentChanged(event: ConsentChangedEvent) {
                loadVendor()
                didomi.removeEventListener(this)
            }
        })
    }
}

Didomi.getInstance().onReady { loadVendor() }
func loadVendor() {
    let didomi: Didomi = Didomi.shared
    let vendorHasConsent = didomi.getUserStatus().vendors.globalConsent.enabled.contains("vendor-id")
    
    if vendorHasConsent {
        // We have consent for the vendor
        // Initialize the vendor SDK
    } else {
        let didomiEventListener = EventListener()
        didomiEventListener.onConsentChanged = { [unowned self] event in
            self.loadVendor()
            didomi.removeEventListener(listener: didomiEventListener)
        }
        didomi.addEventListener(listener: didomiEventListener)
    }
}

Didomi.shared.onReady {
    self.loadVendor()
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    Didomi *didomi = [Didomi shared];
    [didomi onReadyWithCallback:^{
        [self loadVendor];
    }];
}

- (void)loadVendor {
    Didomi *didomi = [Didomi shared];
    NSSet<NSString *>* enabledVendorsConsent = [[[[didomi getUserStatus] vendors] globalConsent] enabled];
    
    if ([enabledVendorsConsent containsObject:@"vendor-id"]) {
        // We have consent for the vendor
        // Initialize the vendor SDK
    } else {
        DDMEventListener *didomiEventListener = [[DDMEventListener alloc] init];
        __weak DDMEventListener *wDidomiEventListener = didomiEventListener;
        [didomiEventListener setOnConsentChanged:^(enum DDMEventType event) {
            [self loadVendor];
            [didomi removeEventListenerWithListener: wDidomiEventListener];
        }];
        [didomi addEventListenerWithListener:didomiEventListener];
    }
}
public void LoadVendor()
{
    ISet<String> enabledVendors = Didomi.GetInstance().GetUserStatus().GetVendors().GetGlobalConsent().GetEnabled();
    bool vendorHasConsent = enabledVendors.Contains("vendor-id");

    if (vendorHasConsent)
    {
        // We have consent for the vendor
        // Initialize the vendor SDK and pass the positive consent status
    }
    else
    {
        // We do not have consent information yet
        // Wait until we get the user information
        DidomiEventListener eventListener = new DidomiEventListener();
        eventListener.ConsentChanged += EventListener_ConsentChanged;

        Didomi.GetInstance().AddEventListener(eventListener);
    }
}

private void EventListener_ConsentChanged(object sender, ConsentChangedEvent e)
{
    LoadVendor();
}

Didomi.GetInstance().OnReady( () =>  LoadVendor() );
async function loadVendor() {
  let vendorHasConsent = (await Didomi.getUserStatus()).vendors.global_consent.enabled.includes("vendor-id");
  if (vendorHasConsent) {
    // We have consent for the vendor
    // Initialize the vendor SDK
  } else {
    let consentListener = (data: any) => {
      loadVendor();
      Didomi.removeEventListener(DidomiEventType.CONSENT_CHANGED, consentListener);
    };
    Didomi.addEventListener(DidomiEventType.CONSENT_CHANGED, consentListener);
  }
}

Didomi.onReady().then(() => {
  loadVendor();
});
void requestLoadVendor() {
  final consentListener = EventListener();
  consentListener.onConsentChanged = () {
    loadVendorIfConsent(consentListener);
    consentListener.onConsentChanged = () {};
  };
  DidomiSdk.addEventListener(consentListener);

  loadVendorIfConsent(consentListener);
}

void loadVendorIfConsent(EventListener consentListener) async {
  final hasVendorStatus = (await DidomiSdk.userStatus).vendors?.globalConsent?.enabled?.contains("vendor-id") == true;
  if (hasVendorStatus) {
    // We have consent for the vendor
    // Initialize the vendor SDK
    consentListener.onConsentChanged = () {};
  }
}

DidomiSdk.onReady(() => { requestLoadVendor() });

Google Additional Consent Mode

To handle it, the values for positive and negative additional consent string have to be set in the custom JSON:

{
  "app": {
    "vendors": {
      "google": {
        "additionalConsent": {
          "positive": "positive-additional-consent",
          "negative": ""
        }
      }
    }
  }
}

The key names are a combination of the “IABGPP_” prefix followed by the section prefix followed by an underline and then followed by the name of the value as specified .

The mobile SDK supports Google Additional Consent Mode, as described in .

IAB GDPR Consent framework
see the list here
Getting Started
Global Privacy Platform (GPP)
help center documentation
NSUserDefaults
SharedPreferences
here
Google's additional consent mode