RequestConfiguration

public final class RequestConfiguration


Global configuration that will be used for every ad request.

Summary

Nested types

@Retention(value = AnnotationRetention.SOURCE)
@StringDef(value = ["", "G", "PG", "T", "MA"])
public annotation RequestConfiguration.MaxAdContentRating

Allowed constants for MaxAdContentRating.

@Retention(value = AnnotationRetention.SOURCE)
@IntDef(value = [-1, 0, 1])
public annotation RequestConfiguration.TagForChildDirectedTreatment

Allowed constants for TagForChildDirectedTreatment.

@Retention(value = AnnotationRetention.SOURCE)
@IntDef(value = [-1, 0, 1])
public annotation RequestConfiguration.TagForUnderAgeOfConsent

Allowed constants for TagForUnderAgeOfConsent.

Constants

static final @NonNull String

Content suitable for general audiences, including families.

static final @NonNull String

Content suitable only for mature audiences.

static final @NonNull String

Content suitable for most audiences with parental guidance.

static final @NonNull String

Content suitable for teen and older audiences.

static final @NonNull String

No specified content rating.

static final int

Indicates that ad requests should not be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

static final int

Indicates that ad requests should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

static final int

Provides no indication whether ad requests should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

static final int

Indicates the publisher specified that the ad request should not receive treatment for users in the European Economic Area (EEA) under the age of consent.

static final int

Indicates the publisher specified that the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent.

static final int

Indicates that the publisher has not specified whether the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent.

Public constructors

RequestConfiguration(
    @RequestConfiguration.TagForChildDirectedTreatment int tagForChildDirectedTreatment,
    @RequestConfiguration.TagForUnderAgeOfConsent int tagForUnderAgeOfConsent,
    @RequestConfiguration.MaxAdContentRating @NonNull String maxAdContentRating,
    @NonNull List<@NonNull String> testDeviceIds
)

Constants

MAX_AD_CONTENT_RATING_G

public static final @NonNull String MAX_AD_CONTENT_RATING_G

Content suitable for general audiences, including families.

MAX_AD_CONTENT_RATING_MA

public static final @NonNull String MAX_AD_CONTENT_RATING_MA

Content suitable only for mature audiences.

MAX_AD_CONTENT_RATING_PG

public static final @NonNull String MAX_AD_CONTENT_RATING_PG

Content suitable for most audiences with parental guidance.

MAX_AD_CONTENT_RATING_T

public static final @NonNull String MAX_AD_CONTENT_RATING_T

Content suitable for teen and older audiences.

MAX_AD_CONTENT_RATING_UNSPECIFIED

public static final @NonNull String MAX_AD_CONTENT_RATING_UNSPECIFIED

No specified content rating.

TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE

public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE = 0

Indicates that ad requests should not be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE

public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE = 1

Indicates that ad requests should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED

public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED

Provides no indication whether ad requests should be treated as child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE = 0

Indicates the publisher specified that the ad request should not receive treatment for users in the European Economic Area (EEA) under the age of consent.

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE = 1

Indicates the publisher specified that the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent.

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED

Indicates that the publisher has not specified whether the ad request should receive treatment for users in the European Economic Area (EEA) under the age of consent.

Public constructors

RequestConfiguration

public RequestConfiguration(
    @RequestConfiguration.TagForChildDirectedTreatment int tagForChildDirectedTreatment,
    @RequestConfiguration.TagForUnderAgeOfConsent int tagForUnderAgeOfConsent,
    @RequestConfiguration.MaxAdContentRating @NonNull String maxAdContentRating,
    @NonNull List<@NonNull String> testDeviceIds
)

Public methods

getMaxAdContentRating

public final @NonNull String getMaxAdContentRating()

getTagForChildDirectedTreatment

public final int getTagForChildDirectedTreatment()

getTagForUnderAgeOfConsent

public final int getTagForUnderAgeOfConsent()

getTestDeviceIds

public final @NonNull List<@NonNull StringgetTestDeviceIds()