Skip to content

ConsentInformation

The ConsentInformation class provides methods to check the current consent status, request consent information updates, and reset consent state. Access it via UserMessagingPlatform.consent_information (GDScript) or UserMessagingPlatform.ConsentInformation (C#).

Enums

Enum Description
ConsentStatus Indicates the user's consent status.
PrivacyOptionsRequirementStatus Indicates whether privacy options are required.

Methods

Returns the current consent status of the user.

func get_consent_status() -> ConsentStatus
public ConsentStatus GetConsentStatus()

Returns whether a consent form is available to load.

func get_is_consent_form_available() -> bool
public bool GetIsConsentFormAvailable()

get_privacy_options_requirement_status / GetPrivacyOptionsRequirementStatus

Returns whether the user is required to be presented with privacy options.

func get_privacy_options_requirement_status() -> PrivacyOptionsRequirementStatus
public PrivacyOptionsRequirementStatus GetPrivacyOptionsRequirementStatus()

update / Update

Requests a consent information update with the given parameters.

func update(
    consent_request: ConsentRequestParameters,
    on_consent_info_updated_success := func(): pass,
    on_consent_info_updated_failure := func(form_error: FormError): pass
) -> void

Usage:

var request_params := ConsentRequestParameters.new()
request_params.tag_for_under_age_of_consent = false

UserMessagingPlatform.consent_information.update(
    request_params,
    func():
        print("Consent info updated successfully")
    ,
    func(form_error: FormError):
        print("Failed to update consent info: ", form_error.message)
)

public void Update(
    ConsentRequestParameters consentRequest,
    Action onSuccess = null,
    Action<FormError> onFailure = null
)

Usage:

var requestParams = new ConsentRequestParameters();
requestParams.TagForUnderAgeOfConsent = false;

UserMessagingPlatform.ConsentInformation.Update(
    requestParams,
    () => GD.Print("Consent info updated successfully"),
    (formError) => GD.Print("Failed to update consent info: " + formError.Message)
);


reset / Reset

Resets the consent state to undetermined.

func reset() -> void
public void Reset()