RequestConfiguration

public class RequestConfiguration


用於每個 AdRequest 的全域設定。

摘要

巢狀型別

RequestConfiguration 的建構工具。

setMaxAdContentRating 允許的常數。

發布商隱私權處理方式的個人化狀態。

這個註解已淘汰。

請改用 setAgeRestrictedTreatment

這個註解已淘汰。

請改用 setAgeRestrictedTreatment

常數

static final String

適合一般大眾 (包括家庭) 的內容。

static final String

內容只適合成人觀眾。

static final String

內容適合大多數觀眾 (需有家長陪伴輔導)。

static final String

內容適合青少年和成人觀眾。

static final String

未指定內容分級。

static final int

這個欄位已淘汰。

請改用 UNSPECIFIED

static final int

這個欄位已淘汰。

請改用 CHILD

static final int

這個欄位已淘汰。

請改用 UNSPECIFIED

static final int

這個欄位已淘汰。

請改用 UNSPECIFIED

static final int

這個欄位已淘汰。

請改用 CHILD

static final int

這個欄位已淘汰。

請改用 UNSPECIFIED

公用方法

AgeRestrictedTreatment

傳回對應 setAgeRestrictedTreatment 設定的值。

String

傳回對應 setMaxAdContentRating 設定的值。

RequestConfiguration.PublisherPrivacyPersonalizationState

傳回發布商隱私權處理方式的個人化狀態。

int

這個方法已淘汰。

請改用 getAgeRestrictedTreatment

int

這個方法已淘汰。

請改用 getAgeRestrictedTreatment

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

表示發布商已指定廣告請求不應對歐洲經濟區境內未滿規定年齡的使用者,採取相應措施。

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE = 1

指出發布商是否要對歐洲經濟區境內未滿規定年齡的使用者,套用廣告請求的適當模式。

public static final int TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED = -1

表示發布商未指定廣告請求是否應對歐洲經濟區 (EEA) 未滿規定年齡的使用者,採取相應措施。

公開欄位

ageRestrictedTreatment

public final @Nullable AgeRestrictedTreatment ageRestrictedTreatment

maxAdContentRating

public final @Nullable String maxAdContentRating

tagForChildDirectedTreatment

public final int tagForChildDirectedTreatment

tagForUnderAgeOfConsent

public final int tagForUnderAgeOfConsent

testDeviceIds

public final List<StringtestDeviceIds

公用方法

getAgeRestrictedTreatment

public AgeRestrictedTreatment getAgeRestrictedTreatment()

傳回對應 setAgeRestrictedTreatment 設定的值。如果從未設定值,則傳回 UNSPECIFIED

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