目录

RequestOptions

Class Info

public class RequestOptions

Settings directed to children, settings directed to users under the age of consent, and ad content rating.

Nested Class Summary

Qualifier and Type

Class Name and Description

static final class

RequestOptions.Builder

Ad request configuration builder.

Public Field Summary

Qualifier and Type

Field and Description

static final String

AD_CONTENT_CLASSIFICATION_W

Content suitable for widespread audiences.

static final String

AD_CONTENT_CLASSIFICATION_PI

Content suitable for audiences with parental guidance.

static final String

AD_CONTENT_CLASSIFICATION_J

Content suitable for junior and older audiences.

static final String

AD_CONTENT_CLASSIFICATION_A

Content suitable for adults only.

static final int

TAG_FOR_CHILD_PROTECTION_FALSE

Does not process ad requests according to the COPPA.

static final int

TAG_FOR_CHILD_PROTECTION_TRUE

Processes ad requests according to the COPPA.

static final int

TAG_FOR_CHILD_PROTECTION_UNSPECIFIED

Whether to process ad requests according to the COPPA is not specified.

static final int

TAG_FOR_UNDER_AGE_OF_PROMISE_TRUE

Processes ad requests as directed to users under the age of consent.

static final int

TAG_FOR_UNDER_AGE_OF_PROMISE_FALSE

Does not process ad requests as directed to users under the age of consent.

static final int

TAG_FOR_UNDER_AGE_OF_PROMISE_UNSPECIFIED

Whether to process ad requests as directed to users under the age of consent is not specified.

Public Method Summary

Qualifier and Type

Method Name and Description

String

getAdContentClassification()

Obtains the maximum ad content rating.

String

getAppCountry()

Obtains the country/region code corresponding to the language in which an ad needs to be returned for an app.

String

getAppLang()

Obtains the language in which an ad needs to be returned for an app.

String

getConsent()

Obtains the user consent string that complies with TCF v2.0.

Integer

getNonPersonalizedAd()

Obtains the setting indicating whether to request non-personalized ads.

Integer

getTagForChildProtection()

Obtains the child-directed setting.

Integer

getTagForUnderAgeOfPromise()

Obtains the setting directed to users under the age of consent.

boolean

isRequestLocation()

Checks whether location information is requested.

RequestOptions.Builder

toBuilder()

Obtains the builder for ad request configurations.

Public Fields

[h2]AD_CONTENT_CLASSIFICATION_W

Fields

public static final String AD_CONTENT_CLASSIFICATION_W

Content suitable for widespread audiences.

For details, please refer to Constant-values.

[h2]AD_CONTENT_CLASSIFICATION_PI

Fields

public static final String AD_CONTENT_CLASSIFICATION_PI

Content suitable for audiences with parental guidance.

For details, please refer to Constant-values.

[h2]AD_CONTENT_CLASSIFICATION_J

Fields

public static final String AD_CONTENT_CLASSIFICATION_J

Content suitable for junior and older audiences.

For details, please refer to Constant-values.

[h2]AD_CONTENT_CLASSIFICATION_A

Fields

public static final String AD_CONTENT_CLASSIFICATION_A

Content suitable for adults only.

For details, please refer to Constant-values.

[h2]TAG_FOR_CHILD_PROTECTION_FALSE

Fields

public static final int TAG_FOR_CHILD_PROTECTION_FALSE

Does not process ad requests according to the COPPA.

For details, please refer to Constant-values.

[h2]TAG_FOR_CHILD_PROTECTION_TRUE

Fields

public static final int TAG_FOR_CHILD_PROTECTION_TRUE

Processes ad requests according to the COPPA.

For details, please refer to Constant-values.

[h2]TAG_FOR_CHILD_PROTECTION_UNSPECIFIED

Fields

public static final int TAG_FOR_CHILD_PROTECTION_UNSPECIFIED

Whether to process ad requests according to the COPPA is not specified.

For details, please refer to Constant-values.

[h2]TAG_FOR_UNDER_AGE_OF_PROMISE_FALSE

Fields

public static final int TAG_FOR_UNDER_AGE_OF_PROMISE_FALSE

Does not process ad requests as directed to users under the age of consent.

For details, please refer to Constant-values.

[h2]TAG_FOR_UNDER_AGE_OF_PROMISE_TRUE

Fields

public static final int TAG_FOR_UNDER_AGE_OF_PROMISE_TRUE

Processes ad requests as directed to users under the age of consent.

For details, please refer to Constant-values.

[h2]TAG_FOR_UNDER_AGE_OF_PROMISE_UNSPECIFIED

Fields

public static final int TAG_FOR_UNDER_AGE_OF_PROMISE_UNSPECIFIED

Whether to process ad requests as directed to users under the age of consent is not specified.

For details, please refer to Constant-values.

Public Methods

[h2]getAdContentClassification

Method

public String getAdContentClassification()

Obtains the maximum ad content rating.

Returns

Type

Description

String

Maximum ad content rating.

[h2]getAppCountry

Method

public String getAppCountry()

Obtains the country/region code corresponding to the language in which an ad needs to be returned for an app.

Returns

Type

Description

String

Country/Region code corresponding to the language in which an ad needs to be returned for an app.

[h2]getAppLang

Method

public String getAppLang()

Obtains the language in which an ad needs to be returned for an app.

Returns

Type

Description

String

Language in which an ad needs to be returned for an app.

[h2]getConsent

Method

public String getConsent()

Obtains the user consent string that complies with TCF v2.0.

Returns

Type

Description

String

User consent string that complies with TCF v2.0.

[h2]getNonPersonalizedAd

Method

public Integer getNonPersonalizedAd()

Obtains the setting indicating whether to request non-personalized ads.

Returns

Type

Description

Integer

Setting indicating whether non-personalized ads are requested.

[h2]getTagForChildProtection

Method

public Integer getTagForChildProtection()

Obtains the child-directed setting.

Returns

Type

Description

Integer

Child-directed setting.

[h2]getTagForUnderAgeOfPromise

Method

public Integer getTagForUnderAgeOfPromise()

Obtains the setting directed to users under the age of consent.

Returns

Type

Description

Integer

Setting directed to users under the age of consent.

[h2]isRequestLocation

Method

public boolean isRequestLocation()

Checks whether location information is requested.

Returns

Type

Description

boolean

Whether location information is requested.

  • true: yes
  • false: no

[h2]toBuilder

Method

public RequestOptions.Builder toBuilder()

Obtains the builder for ad request configurations.

Returns

Type

Description

RequestOptions.Builder

Ad request configuration builder.