RequestConfiguration

public class RequestConfiguration


将用于每个 AdRequest 的全局配置。

摘要

嵌套类型

RequestConfiguration 的构建器。

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

setMaxAdContentRating 的允许常量。

发布商隐私保护处理措施个性化状态。

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

setTagForChildDirectedTreatment 的允许常量。

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

setTagForUnderAgeOfConsent 的允许常量。

常量

static final String

适合一般受众(包括家庭)的内容。

static final String

仅适合成人受众的内容。

static final String

适合大多数受众(未成年人需在家长指导下观看)的内容。

static final String

适合青少年和年龄更大的受众群体的内容。

static final String

未指定内容分级。

static final int

表示根据《儿童在线隐私保护法》(COPPA) 的规定,不应将广告请求视为面向儿童的内容。

static final int

表示广告请求应根据《儿童在线隐私保护法》(COPPA) 的规定被视为面向儿童的内容。

static final int

未指明广告请求是否应根据《儿童在线隐私保护法》(COPPA) 的规定被视为面向儿童的内容。

static final int

表示发布商指定了广告请求不应按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理。

static final int

表示发布商指定了应按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求。

static final int

表示发布商未指定是否应按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求。

公共方法

String

返回由相应的 setMaxAdContentRating 设置的值。

RequestConfiguration.PublisherPrivacyPersonalizationState

返回发布商隐私保护处理措施个性化状态。

int

返回由相应的 setTagForChildDirectedTreatment 设置的值。

int

返回由相应的 setTagForUnderAgeOfConsent 设置的值。

List<String>

返回与测试设备对应的测试设备 ID,该测试设备将始终请求测试广告。

RequestConfiguration.Builder

返回包含此 RequestConfiguration 中值的 Builder

常量

MAX_AD_CONTENT_RATING_G

public static final String MAX_AD_CONTENT_RATING_G = "G"

适合一般受众(包括家庭)的内容。

MAX_AD_CONTENT_RATING_MA

public static final String MAX_AD_CONTENT_RATING_MA = "MA"

仅适合成人受众的内容。

MAX_AD_CONTENT_RATING_PG

public static final String MAX_AD_CONTENT_RATING_PG = "PG"

适合大多数受众(未成年人需在家长指导下观看)的内容。

MAX_AD_CONTENT_RATING_T

public static final String MAX_AD_CONTENT_RATING_T = "T"

适合青少年和年龄更大的受众群体的内容。

MAX_AD_CONTENT_RATING_UNSPECIFIED

public static final String MAX_AD_CONTENT_RATING_UNSPECIFIED = ""

未指定内容分级。

TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE

public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE = 0

表示根据《儿童在线隐私保护法》(COPPA) 的规定,不应将广告请求视为面向儿童的内容。

TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE

public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE = 1

表示广告请求应根据《儿童在线隐私保护法》(COPPA) 的规定被视为面向儿童的内容。

TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED

public static final int TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED = -1

未指明广告请求是否应根据《儿童在线隐私保护法》(COPPA) 的规定被视为面向儿童的内容。

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE = 0

表示发布商指定了广告请求不应按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理。

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE = 1

表示发布商指定了应按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求。

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED = -1

表示发布商未指定是否应按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求。

公共字段

maxAdContentRating

public final @Nullable String maxAdContentRating

tagForChildDirectedTreatment

public final int tagForChildDirectedTreatment

tagForUnderAgeOfConsent

public final int tagForUnderAgeOfConsent

testDeviceIds

public final List<StringtestDeviceIds

公共方法

getMaxAdContentRating

@RequestConfiguration.MaxAdContentRating
public String getMaxAdContentRating()

返回由相应的 setMaxAdContentRating 设置的值。

getPublisherPrivacyPersonalizationState

public RequestConfiguration.PublisherPrivacyPersonalizationState getPublisherPrivacyPersonalizationState()

返回发布商隐私保护处理措施个性化状态。

getTagForChildDirectedTreatment

@RequestConfiguration.TagForChildDirectedTreatment
public int getTagForChildDirectedTreatment()

返回由相应的 setTagForChildDirectedTreatment 设置的值。

getTagForUnderAgeOfConsent

@RequestConfiguration.TagForUnderAgeOfConsent
public int getTagForUnderAgeOfConsent()

返回由相应 setTagForUnderAgeOfConsent 设置的值。

getTestDeviceIds

public List<StringgetTestDeviceIds()

返回与测试设备对应的测试设备 ID,该测试设备将始终请求测试广告。如果之前未设置测试设备 ID,则返回空列表。

toBuilder

public RequestConfiguration.Builder toBuilder()

返回包含此 RequestConfiguration 中值的 Builder