Deprecated

Notice Config

getRequiredPurposeIds

Removed since version 2.0.0, use getRequiredPurposes instead.

Get the list of purpose IDs that are required (automatically determined from the list of required vendors).

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Type (Swift)

Type (Objective-C)

Description

Set<String>

NSSet<NSString *> *

A set of type String containing the IDs of required purposes.

Example

Didomi.shared.getRequiredPurposeIds()

getRequiredVendorIds

Removed since version 2.0.0, use getRequiredVendors instead.

Get the list of vendor IDs that are required (determined from the configuration).

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Type (Swift)

Type (Objective-C)

Description

Set<String>

NSSet<NSString *> *

A set of type String containing the IDs of required vendors.

Example

Didomi.shared.getRequiredVendorIds()

User Status

getUserConsentStatusForPurpose

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserConsentStatusForVendor

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserConsentStatusForVendorAndRequiredPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserLegitimateInterestStatusForPurpose

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserLegitimateInterestForVendor

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserLegitimateInterestStatusForVendorAndRequiredPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getUserStatus

Deprecated, use getCurrentUserStatus instead.

Get all the user consent status.

Returns

A UserStatus object describing all the available and computed user information.

Parameter

Type

Description

purposes.global.disabled

Set<String>

Computed sets/lists of disabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis.

purposes.global.enabled

Set<String>

Computed sets/lists of enabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis. Purposes considered as essential will be part of the enabled IDs.

purposes.consent.disabled

Set<String>

Disabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.

purposes.consent.enabled

Set<String>

Enabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.

purposes.legitimateInterest.disabled

Set<String>

Disabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

purposes.legitimateInterest.enabled

Set<String>

Enabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

purposes.essential

Set<String>

IDs of purposes that are considered essential.

vendors.global.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.global.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalConsent.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalConsent.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalLegitimateInterest.disabled

Set<String>

Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.globalLegitimateInterest.enabled

Set<String>

Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.

vendors.consent.disabled

Set<String>

Disabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.

vendors.consent.enabled

Set<String>

Enabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.

vendors.legitimateInterest.disabled

Set<String>

Disabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

vendors.legitimateInterest.enabled

Set<String>

Enabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.

userId

String

Didomi user id.

created

String

User choices creation date.

updated

String

User choices update date.

consentString

String

TFC consent as string.

additionalConsent

String

Additional consent for Google Additional Consent Mode.

regulation

Regulation

Representation of the current regulation as a Regulation enum value, such as gdpr, ccpa, cpra, or none. Note that some regulations present as enum values are not available yet.

Example

let userStatus = Didomi.shared.getUserStatus()

// Enabled consent ids for vendors
let enabledVendorsConsentIds = userStatus.vendors.consent.enabled

getUserStatusForVendor

Removed since version 2.0.0, use getCurrentUserStatus instead.

getDisabledPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

Get the list of purposes that have been disabled by the user.

Not available for Objective-C

This function is only exposed to Swift apps and cannot be called from Objective-C.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Type

Description

[Purpose]

An array of type Purpose containing the purposes disabled by the user.

Example

Didomi.shared.getDisabledPurposes()

getDisabledPurposeIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

Get the list of purpose IDs that have been disabled by the user.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Type (Swift)

Type (Objective-C)

Description

Set<String>

NSSet<NSString *> *

A set of type String containing the IDs of purposes disabled by the user.

Example

Didomi.shared.getDisabledPurposeIds()

getDisabledVendors

Removed since version 2.0.0, use getCurrentUserStatus instead.

Get the list of vendors that have been disabled by the user.

Not available for Objective-C

This function is only exposed to Swift apps and cannot be called from Objective-C.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Type

Description

[Vendor]

An array of type Vendor containing the vendors disabled by the user.

Example

Didomi.shared.getDisabledVendors()

getDisabledVendorIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledPurposes

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledPurposeIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledVendors

Removed since version 2.0.0, use getCurrentUserStatus instead.

getEnabledVendorIds

Removed since version 2.0.0, use getCurrentUserStatus instead.

isConsentRequired

Deprecated, use getCurrentUserStatus and check that the field regulationis not .none

Determine if consent is required for the user. This takes into account the location of the user and the configuration of the SDK:

  • If your app is configured to apply GDPR to all users then this function always returns true.

  • If your app is configured to apply GDPR to EU users only then this function returns true only if the user in the EU.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Bool

Example

Didomi.shared.isConsentRequired()

isUserConsentStatusPartial

Deprecated, use isUserStatusPartial instead.

Determine if all consent information is available for the user.

This function returns true if and only if:

  • Consent is required for the user (ie the user is in the EU or your tag is configured to apply GDPR to all users)

  • At least one vendor is configured (if there is no vendor configured, this function always returns false as there is no consent to collect)

  • We miss consent information for some vendors or purposes

If there is at least one piece of consent information missing for a single vendor/purpose, this function will return true. The consent notice is usually displayed when this function returns true although there is no guarantee of the direct mapping between the two.

An important edge case is when you add new vendors or if configured vendors ask for new purposes: the consent notice will be displayed again and this function will return true until the user has given or denied consent. Vendors that already had consent before will still operate normally as we only recollect consent for additional vendors/purposes.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Bool

Example

Didomi.shared.isUserConsentStatusPartial()

isUserLegitimateInterestStatusPartial

Deprecated, use isUserStatusPartial instead.

Determine if all Legitimate Interest information is available for the user.

This function returns true if and only if:

  • Legitimate Interest is required for the user (ie the user is in the EU or your tag is configured to apply GDPR to all users)

  • At least one vendor is configured (if there is no vendor configured, this function always returns false as there is no Legitimate Interest to collect)

  • We miss Legitimate Interest information for some vendors or purposes

If there is at least one piece of Legitimate Interest information missing for a single vendor/purpose, this function will return true. The consent notice is usually displayed when this function returns true although there is no guarantee of the direct mapping between the two.

An important edge case is when you add new vendors or if configured vendors ask for new purposes: the consent notice will be displayed again and this function will return true until the user has given or denied consent. Vendors that already had Legitimate Interest before will still operate normally as we only recollect Legitimate Interest for additional vendors/purposes.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

Bool

Example

Didomi.shared.isUserLegitimateInterestStatusPartial()

setUserConsentStatus

Removed since version 2.0.0, use setCurrentUserStatus instead.

Set the user consent status for purposes and vendors. This function will trigger events and API calls every time it is called (and the user status changes) so make sure to push all your consent information at once and not one by one.

Please read our article on what to expect from your analytics when setting a custom behavior for your consent notice.

Requires SDK to be initialized

Yes.

Parameters

Name

Type

Description

enabledPurposeIds

Set<String>

Set of purpose IDs that the user has given consent to

disabledPurposeIds

Set<String>

Set of purpose IDs that the user has not given consent to

enabledVendorIds

Set<String>

Set of vendor IDs that the user has given consent to

disabledVendorIds

Set<String>

Set of vendor IDs that the user has not given consent to

Returns

Bool

true if the user consent status has changed (i.e. the user had given different consent information before this function got called).

Example

let didomi = Didomi.shared
didomi.setUserConsentStatus(enabledPurposeIds: ["1", "2"],
                            disabledPurposeIds: ["3", "4"],
                            enabledVendorIds: ["1", "2"],
                            disabledVendorIds: ["3", "4"])

setUserStatus

Removed since version 2.0.0, use setCurrentUserStatus instead.

Set the user status for purposes and vendors. This function will trigger events and API calls every time it is called (and the user status changes) so make sure to push all user choices at once and not one by one.

Please read our article on what to expect from your analytics when setting a custom behavior for your consent notice.

Parameters

Global method :

Define a global status for consent purposes, legitimate interest purposes, consent vendors, legitimate interest vendors

Name

Type

Description

purposesConsentStatus

boolean

true if purposes on a consent basis should be enabled, false if they should be disabled

purposesLIStatus

boolean

true if purposes on a legitimate interest basis should be enabled, false if they should be disabled

vendorsConsentStatus

boolean

true if vendors on a consent basis should be enabled, false if they should be disabled

vendorsLIStatus

boolean

true if vendors on a legitimate interest basis should be enabled, false if they should be disabled

Example

Didomi.shared.setUserStatus(
    purposesConsentStatus: false,
    purposesLIStatus: true,
    vendorsConsentStatus: false,
    vendorsLIStatus: true)

Individual purposes / vendors method :

Allows to define precisely which purposes and vendors are enabled / disabled

Name

Type

Description

enabledConsentPurposeIds

Set<String>

Set of purpose IDs that the user has given consent to

disabledConsentPurposeIds

Set<String>

Set of purpose IDs that the user has not given consent to

enabledLIPurposeIds

Set<String>

Set of purpose IDs that the user has allowed legitimate interest processing to

disabledLIPurposeIds

Set<String>

Set of purpose IDs that the user has disallowed legitimate interest processing to

enabledConsentVendorIds

Set<String>

Set of vendor IDs that the user has given consent to.

Prefix custom vendor IDs with c:.

disabledConsentVendorIds

Set<String>

Set of vendor IDs that the user has not given consent to

enabledLIVendorIds

Set<String>

Set of vendor IDs that the user has allowed legitimate interest processing to.

Prefix custom vendor IDs with c:.

disabledLIVendorIds

Set<String>

Set of vendor IDs that the user has not allowed legitimate interest processing to

Example

Didomi.shared.setUserStatus(
    enabledConsentPurposeIds: ["cookies", "ad_delivery"],
    disabledConsentPurposeIds: ["market_research"],
    enabledLIPurposeIds: ["cookies", "market_research"],
    disabledLIPurposeIds: ["ad_delivery"],
    enabledConsentVendorIds: ["123", "c:custom-vendor-id"],
    disabledConsentVendorIds: ["125"],
    enabledLIVendorIds: ["123", "125", "c:custom-vendor-id"],
    disabledLIVendorIds: []
)

shouldConsentBeCollected

Deprecated, use shouldUserStatusBeCollected instead.

Determine if consent should be collected for the visitor. Returns true if consent is required for the current user and one of following two conditions is met:

  • Consent has never been collected for this visitor yet

  • New consents should be collected (as new vendors have been added) AND the number of days before recollecting them has exceeded

If none of these two conditions is met, the function returns false. This function is mainly present to allow you to know when to display your own notice if you have disabled our standard notice.

Requires SDK to be initialized

Yes.

Parameters

No parameter.

Returns

boolean

Example

Didomi.shared.shouldConsentBeCollected()

Last updated