Consent

This page provides an overview of the Huawei Ads Kit consent functionality for developers.

The concept of consent in the Huawei Ads Kit refers to the user's agreement to receive personalized ads. The provided methods, located in the HmsAdsKitManager.cson HMS Unity plugin, facilitate the management of this consent. These methods are crucial for developers looking to integrate and customize consent features in their apps.

Methods in HmsAdsKitManager:

The implementation of these methods can be found in the HmsAdsKitManager.cs.

Example Usage:

For a practical demonstration, developers can refer to the AdsDemoManager.cs in the Ads Demo Scene. This scene provides insights into how these consent methods can be utilized within a Unity project.

Method Overview:

  1. RequestConsentUpdate(): Initiates a request to update the consent status, triggering the OnSuccess or OnFail methods in the provided listener [1].

  2. SetConsentStatus(ConsentStatus consentStatus): Programmatically sets the user's consent status based on the provided enumeration. You should ask yo your users to define their choice.

  3. SetDebugNeedConsent(DebugNeedConsent debugNeedConsent): Configures the debug consent status for testing purposes.

  4. SetUnderAgeOfPromise(bool underAgeOfPromise): Specifies whether the user is under the age of promise, ensuring compliance with regulations related to advertising to minors.

  5. string TestDeviceId: Obtains a test device ID.

  6. AddTestDeviceId(string testDeviceId): Adds a test device ID. Use the obtained device ID to add your device as a debug device to the trustlist.

Listeners:

The ConsentUpdateListener handles success and failure events, logging relevant information.

Ensure to call RequestConsentUpdate before using the listeners to guarantee accurate functionality.

🌐 For More Information

Last updated