public interface AdConsentController
A provider’s consent and privacy controller, backing the public
AdConsent facade. Implementations wrap the GDPR consent
flow (e.g. Google’s User Messaging Platform) and, on iOS, the App Tracking
Transparency prompt.
This is an internal SPI type.
Methods
public abstract void requestConsent(boolean underAgeOfConsent, AdCallback<Integer> onComplete) | Gathers consent if required, presenting the consent form when necessary, and (on iOS) the App Tracking Transparency prompt. |
public abstract int getConsentStatus() | The current consent status without triggering a new request. |
public abstract boolean canRequestAds() | True when the provider has enough consent to request ads. |
public abstract void reset() | Clears stored consent. |
Method details
requestConsent
public abstract void requestConsent(boolean underAgeOfConsent, AdCallback<Integer> onComplete)Gathers consent if required, presenting the consent form when necessary,
and (on iOS) the App Tracking Transparency prompt. The callback receives
the resulting status (one of the
STATUS_* constants in
AdConsent) on completion.Parameters
underAgeOfConsentboolean- whether the user is tagged as under the age of consent
onCompleteAdCallback<Integer>- invoked with the resulting consent status
getConsentStatus
public abstract int getConsentStatus()The current consent status without triggering a new request.
canRequestAds
public abstract boolean canRequestAds()True when the provider has enough consent to request ads.
reset
public abstract void reset()Clears stored consent. Intended for testing only.