ManagedConsent

class ManagedConsent(cmp: CMP, context: Context, delegate: ManagedConsent.ManagedConsentDelegate, showIfNeededSetting: ManagedConsent.ShowIfNeededSetting) : ConsentImplementation, Consent, CMPDelegate

Will present a dialog for the users to grant or withhold their consent.

Parameters

cmp

Instance of CMP to be used.

context

The Context of your application.

delegate

The ManagedConsentDelegate instance. Must not be null.

showIfNeededSetting

ShowIfNeededSetting setting how the showIfNeeded method should behave. ShowIfNeededSetting.SERVER_SIDE_CONTROL by default.

Constructors

Link copied to clipboard
constructor(cmp: CMP, context: Context, delegate: ManagedConsent.ManagedConsentDelegate)

Will present a dialog for the users to grant or withhold their consent.

constructor(cmp: CMP, context: Context, delegate: ManagedConsent.ManagedConsentDelegate, showIfNeededSetting: ManagedConsent.ShowIfNeededSetting)

Types

Link copied to clipboard

Notifies about the need to show the consent dialog.

Link copied to clipboard

Possible states of consent given by the user.

Inherited properties

Link copied to clipboard
Link copied to clipboard
var consentStringVersion: ConsentImplementation.ConsentStringVersion?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun CMPNeedsUI()
Link copied to clipboard
open override fun didShowCMP()
Link copied to clipboard
fun editConsent(activity: Activity)

Presents the consent screen, allowing the user to change consent settings.

Link copied to clipboard
open override fun onCMPFailedToLoad(error: String)
Link copied to clipboard
open override fun onCMPFailedToShow(error: String)
Link copied to clipboard
Link copied to clipboard
fun reload(activity: Activity)

Tells the CMP to reload. You can call this method for example after receiving ManagedConsentDelegate.managedConsentCMPFailedToLoad callback.

Link copied to clipboard
fun showIfNeeded(activity: Activity)

Presents the consent screen ONLY if it is required by the used CMP (i.e. no user consent has been set yet).

Link copied to clipboard
fun showIfNeededOrRejected(daysAgo: Int, activity: Activity)

Presents the consent screen if it is required by the used CMP (i.e. no user consent has been set yet) or the user has rejected the consent.

Link copied to clipboard
open override fun toString(): String

Inherited functions

Link copied to clipboard
Link copied to clipboard
fun reconfigure(context: Context)
Link copied to clipboard
abstract fun setNoConsentNetworkStopSet(stopSet: Set<AdNetwork>?)

Sets to set the networks that will not be requested if they do not have the TCF2 consent. Only works if TCF2 compliant CMP is used.