Deprecated
Notice Config
getDisabledPurposes
Removed since version 2.0.0, use getCurrentUserStatus instead.
getDisabledPurposeIds
Removed since version 2.0.0, use getCurrentUserStatus instead.
getDisabledVendors
Removed since version 2.0.0, use getCurrentUserStatus instead.
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.
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.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
Type | Description |
---|---|
| A set of type |
Example
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.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
Type | Description |
---|---|
| A set of type |
Example
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.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
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 |
| Representation of the current regulation as a |
Example
getUserStatusForVendor
Removed since version 2.0.0, use getCurrentUserStatus instead.
isConsentRequired
Deprecated, use getCurrentUserStatus and check that the field regulation
is not Regulation.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.
Parameters
No parameter.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
boolean
Example
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.
Parameters
No parameter.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
boolean
Example
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.
Parameters
No parameter.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
boolean
Example
setUserConsentStatus
Deprecated, use setCurrentUserStatus instead.
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 |
|
|
purposesLIStatus |
|
|
vendorsConsentStatus |
|
|
vendorsLIStatus |
|
|
Example
Individual purposes/vendors method:
Allows to define precisely which purposes and vendors are enabled / disabled
Name | Type | Description |
---|---|---|
enabledConsentPurposeIds |
| Set of purpose IDs that the user has given consent to |
disabledConsentPurposeIds |
| Set of purpose IDs that the user has not given consent to |
enabledLIPurposeIds |
| Set of purpose IDs that the user has allowed legitimate interest processing to |
disabledLIPurposeIds |
| Set of purpose IDs that the user has disallowed legitimate interest processing to |
enabledConsentVendorIds |
| Set of vendor IDs that the user has given consent to. Prefix custom vendor IDs with |
disabledConsentVendorIds |
| Set of vendor IDs that the user has not given consent to |
enabledLIVendorIds |
| Set of vendor IDs that the user has allowed legitimate interest processing to. Prefix custom vendor IDs with |
disabledLIVendorIds |
| Set of vendor IDs that the user has not allowed legitimate interest processing to |
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
boolean
true
if the user choices have changed (i.e. the user had made different choices before this function got called).
Example
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.
Parameters
No parameter.
Throws
Type | Description |
DidomiNotReadyException | Exception thrown when a method that requires the Didomi SDK to be ready is called before that. Developers can call this method within a try/catch or within a lambda expression passed into the |
Returns
boolean
Example
Last updated