RequestConfiguration

public class RequestConfiguration


Global configuration that will be used for every AdRequest.

Summary

Nested types

Builder for RequestConfiguration.

@Retention(value = SOURCE)
@StringDef(value = )
public annotation RequestConfiguration.MaxAdContentRating

Allowed constants for setMaxAdContentRating.

Publisher privacy treatment personalization states.

@Retention(value = SOURCE)
@IntDef(value = )
public annotation RequestConfiguration.TagForChildDirectedTreatment

Allowed constants for setTagForChildDirectedTreatment.

@Retention(value = SOURCE)
@IntDef(value = )
public annotation RequestConfiguration.TagForUnderAgeOfConsent

Allowed constants for setTagForUnderAgeOfConsent.

Constants

static final String

Content suitable for general audiences, including families.

static final String

Content suitable only for mature audiences.

static final String

Content suitable for most audiences with parental guidance.

static final String

Content suitable for teen and older audiences.

static final 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 methods

String

Returns the value set by the corresponding setMaxAdContentRating.

RequestConfiguration.PublisherPrivacyPersonalizationState

Returns the publisher privacy treatment personalization state.

int

Returns the value set by the corresponding setTagForChildDirectedTreatment.

int

Returns the value set by the corresponding setTagForUnderAgeOfConsent.

List<String>

Returns the test device IDs corresponding to test device which will always request test ads.

RequestConfiguration.Builder

Returns a Builder with values from this RequestConfiguration.

Constants

MAX_AD_CONTENT_RATING_G

public static final String MAX_AD_CONTENT_RATING_G = "G"

Content suitable for general audiences, including families.

MAX_AD_CONTENT_RATING_MA

public static final String MAX_AD_CONTENT_RATING_MA = "MA"

Content suitable only for mature audiences.

MAX_AD_CONTENT_RATING_PG

public static final String MAX_AD_CONTENT_RATING_PG = "PG"

Content suitable for most audiences with parental guidance.

MAX_AD_CONTENT_RATING_T

public static final String MAX_AD_CONTENT_RATING_T = "T"

Content suitable for teen and older audiences.

MAX_AD_CONTENT_RATING_UNSPECIFIED

public static final 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 = -1

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 = -1

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 fields

maxAdContentRating

public final @Nullable String maxAdContentRating

tagForChildDirectedTreatment

public final int tagForChildDirectedTreatment

tagForUnderAgeOfConsent

public final int tagForUnderAgeOfConsent

testDeviceIds

public final List<StringtestDeviceIds

Public methods

getMaxAdContentRating

@RequestConfiguration.MaxAdContentRating
public String getMaxAdContentRating()

Returns the value set by the corresponding setMaxAdContentRating.

getPublisherPrivacyPersonalizationState

public RequestConfiguration.PublisherPrivacyPersonalizationState getPublisherPrivacyPersonalizationState()

Returns the publisher privacy treatment personalization state.

getTagForChildDirectedTreatment

@RequestConfiguration.TagForChildDirectedTreatment
public int getTagForChildDirectedTreatment()

Returns the value set by the corresponding setTagForChildDirectedTreatment.

getTagForUnderAgeOfConsent

@RequestConfiguration.TagForUnderAgeOfConsent
public int getTagForUnderAgeOfConsent()

Returns the value set by the corresponding setTagForUnderAgeOfConsent.

getTestDeviceIds

public List<StringgetTestDeviceIds()

Returns the test device IDs corresponding to test device which will always request test ads. Returns an empty list if test device IDs were not previously set.

toBuilder

public RequestConfiguration.Builder toBuilder()

Returns a Builder with values from this RequestConfiguration.