πŸ“—
One Consent
  • Next14 CMP
  • Proof of Consent
  • πŸ€” Generic FAQ
  • πŸ“±Mobile APPs
    • Installation
    • The CMP
    • Consents
      • Consents to TCF partners
      • Consents to Google ATP
      • Consents to Custom Partners
    • Debugging the CMP
      • CMP Flow
      • CMP deep link
      • CMP preferences
    • IAB TCF Vendors
    • πŸ€” Technical FAQ
  • Next14 Proximity SDK Docs
Powered by GitBook
On this page
  • CMP Consents internal structure
  • How do third-party SDKs (vendors) access the consent information in-app?

Was this helpful?

  1. πŸ“±Mobile APPs
  2. Consents

Consents to TCF partners

How to interact with SDK from 3rd party Vendors

PreviousConsentsNextConsents to Google ATP

Last updated 2 years ago

Was this helpful?

One Consent provide a native consent flow integration for 3rd Party Vendor that supports IAB TCF 2.0. A full list of the vendor partners of IAB TCF can be consulted here:

Once you install One Consent SDK consents will be saved in a shared memory preference.

No action is usually required on the Vendor SDK, but do check with your provider if you need to activate GDPR behaviour.

For APP developers, CMP stored preferences can be consulted with the standard methods provided from IAB. Full documentation is available on .

CMP Consents internal structure

(iOS) or (Android) are used to store pre-parsed TC data as well as the TC string by a CMP SDK, allowing:

  • Vendors to easily access TC data

  • TC data to persist across app sessions

  • TC data to be portable between CMPs to provide flexibility for a publisher to exchange one CMP SDK for another

  • Vendors within an app to avoid code duplication by not being required to include a TC string decoder while still enabling all typical use cases

Note: If a publisher chooses to remove a CMP SDK from their app they are responsible for clearing all IABTCF_* vestigial values for users so that vendors do not continue to use the TC data therein.

(iOS) or (Android) values

Key
Value(s)

IABTCF_CmpSdkID

Number: The unsigned integer ID of CMP SDK

IABTCF_CmpSdkVersion

Number: The unsigned integer version number of CMP SDK

IABTCF_PolicyVersion

Number: The unsigned integer representing the version of the TCF that these consents adhere to.

IABTCF_gdprApplies

Number:

1 GDPR applies in current context

0 - GDPR does not apply in current context

Unset - undetermined (default before initialization)

IABTCF_PublisherCC

IABTCF_PurposeOneTreatment

Number:

0 - no special treatment of purpose one

1 - purpose one not disclosed

Unset default - 0

Vendors can use this value to determine whether consent for purpose one is required.

IABTCF_UseNonStandardStacks

Number:

1 - CMP used a non-standard stack

0 - CMP did not use a non-standard stack

IABTCF_TCString

String: Full encoded TC string

IABTCF_VendorConsents

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the consent status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is consent true for vendor ID 1

IABTCF_VendorLegitimateInterests

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the legitimate interest status for Vendor ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for vendor ID 1

IABTCF_PurposeConsents

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the consent status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1

IABTCF_PurposeLegitimateInterests

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the legitimate interest status for purpose ID n+1; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1

IABTCF_SpecialFeaturesOptIns

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the opt-in status for special feature ID n+1; false and true respectively. eg. '1' at index 0 is opt-in true for special feature ID 1

IABTCF_PublisherRestrictions{ID}

String ['0','1', or '2']: The value at position n – where n's indexing begins at 0 – indicates the publisher restriction type (0-2) for vendor n+1; (see Publisher Restrictions Types). eg. '2' at index 0 is restrictionType 2 for vendor ID 1. {ID} refers to the purpose ID.

IABTCF_PublisherConsent

IABTCF_PublisherLegitimateInterests

IABTCF_PublisherCustomPurposesConsents

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose consent status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is consent true for custom purpose ID 1

IABTCF_PublisherCustomPurposesLegitimateInterests

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose legitimate interest status for the publisher's custom purpose ID n+1 for the publisher; false and true respectively. eg. '1' at index 0 is legitimate interest established true for custom purpose ID 1

How do third-party SDKs (vendors) access the consent information in-app?

On Android OS, the TC data and TC string shall be stored in the default Shared Preferences for the application context. This can be accessed using the getDefaultSharedPreferences method from the android.preference.PreferenceManager class using the application context.

Example:

Context mContext = getApplicationContext();
SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);

The TC data values can be retrieved from the application Shared Preferences by key name using the get methods on the android.content.SharedPreferences class. For the purposes of accessing TC data, only two methods should be necessary: getString(String key, String defValue) for String values and getInt(String key, int defValue) for integers and integer representations of Boolean values.

Example:

Context mContext = getApplicationContext();
SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
String consentString = mPreferences.getString("IABTCF_TCString", "");
int gdprApplies = mPreferences.getInt("IABTCF_gdprApplies", "");

A callback can be registered to update settings when a preference is changed using the registerOnSharedPreferenceChangeListener method for the android.content.SharedPreferences class.

Example:

Context mContext = getApplicationContext();
SharedPreferences mPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
SharedPreferences.OnSharedPreferenceChangeListener mListener;
mListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
            public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
                        if (key.equals([Specific Consent Key])) {
                                   // Update Consent settings
                                   }
                        }
            };


mPreferences.registerOnSharedPreferenceChangeListener(mListener);

see the section for more

String: – Default: AA (unknown)

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose consent status for purpose ID n+1 for the publisher as they correspond to the Purposes; false and true respectively. eg. '1' at index 0 is consent true for purpose ID 1

Binary String: The '0' or '1' at position n – where n's indexing begins at 0 – indicates the purpose legitimate interest status for purpose ID n+1 for the publisher as they correspond to the Purposes; false and true respectively. eg. '1' at index 0 is legitimate interest established true for purpose ID 1

On both Android OS and iOS, the vendor can get notified when the values of the shared keys change. See and .

Note: The preference manager does not currently store a strong reference to the listener. If you do not store a strong reference, the listener will be susceptible to garbage collection. External guidance such as this may provide more information on listening for preference changes.

https://iabeurope.eu/vendor-list-tcf-v2-0/
IAB github codebase
NSUserDefaults
SharedPreferences
NSUserDefaults
SharedPreferences
NSUserDefaultsDidChangeNotification
SharedPreferences.OnSharedPreferenceChangeListener
documentation on setting listeners
"What does the gdprApplies value mean?"
Two-letter ISO 3166-1 alpha-2 code
Global Vendor List
Global Vendor List