Consent

actual class Consent(activity: Any?)
expect class Consent(activity: Any?)

Manages consent and privacy forms using the Google User Messaging Platform (UMP) SDK.

This class helps you gather consent from your users, which is often a legal requirement (e.g., GDPR). The UMP SDK will attempt to display a privacy message that you configure in the "Privacy & messaging" tab of your AdMob account.

On Android, this class requires an Activity context. For other platforms, you can pass null.

actual class Consent(activity: Any?)

Constructors

Link copied to clipboard
actual constructor(activity: Any?)
expect constructor(activity: Any?)
actual constructor(activity: Any?)

Properties

Link copied to clipboard

Indicates whether you can request ads.

Link copied to clipboard

Indicates whether a privacy options entry point is required.

Functions

Link copied to clipboard
actual fun canRequestAds(): Boolean
expect fun canRequestAds(): Boolean

Checks if ads can be requested.

actual fun canRequestAds(): Boolean
Link copied to clipboard

Checks if a privacy options entry point is required.

Link copied to clipboard
actual fun loadAndShowConsentForm(onLoaded: () -> Unit, onShown: () -> Unit, onError: (Exception) -> Unit)
expect fun loadAndShowConsentForm(onLoaded: () -> Unit = {}, onShown: () -> Unit = {}, onError: (Exception) -> Unit = {})

Loads and shows a consent form if one is required.

actual fun loadAndShowConsentForm(onLoaded: () -> Unit, onShown: () -> Unit, onError: (Exception) -> Unit)
Link copied to clipboard
actual fun requestConsentInfoUpdate(onCompletion: () -> Unit, onError: (Exception) -> Unit)
actual fun requestConsentInfoUpdate(params: ConsentRequestParameters, onCompletion: () -> Unit, onError: (Exception) -> Unit)
expect fun requestConsentInfoUpdate(onCompletion: () -> Unit = {}, onError: (Exception) -> Unit = {})

Requests an update of the user's consent information.

expect fun requestConsentInfoUpdate(params: ConsentRequestParameters, onCompletion: () -> Unit = {}, onError: (Exception) -> Unit = {})

Requests an update of the user's consent information with specific parameters.

actual fun requestConsentInfoUpdate(onCompletion: () -> Unit, onError: (Exception) -> Unit)
actual fun requestConsentInfoUpdate(params: ConsentRequestParameters, onCompletion: () -> Unit, onError: (Exception) -> Unit)
Link copied to clipboard
actual fun reset()
expect fun reset()

Resets the consent state.

actual fun reset()
Link copied to clipboard
actual fun showPrivacyOptionsForm(onDismissed: () -> Unit, onError: (Exception) -> Unit)
expect fun showPrivacyOptionsForm(onDismissed: () -> Unit, onError: (Exception) -> Unit = {})

Shows the privacy options form.

actual fun showPrivacyOptionsForm(onDismissed: () -> Unit, onError: (Exception) -> Unit)