ConsentRequestParameters.Builder

public final class ConsentRequestParameters.Builder


ConsentRequestParameters 的建構工具。

摘要

公用建構函式

公用方法

ConsentRequestParameters
ConsentRequestParameters.Builder

可設定 ConsentDebugSettings

ConsentRequestParameters.Builder

設定同意聲明同步 ID,以同步處理使用相同 ID 收集的使用者同意聲明狀態。

ConsentRequestParameters.Builder
@CanIgnoreReturnValue
setTagForUnderAgeOfConsent(boolean tagForUnderAgeOfConsent)

設定是否將使用者標示為未滿規定年齡。

公用建構函式

Builder

public Builder()

公用方法

build

public ConsentRequestParameters build()

setConsentDebugSettings

@CanIgnoreReturnValue
public ConsentRequestParameters.Builder setConsentDebugSettings(
    @Nullable ConsentDebugSettings consentDebugSettings
)

設定 ConsentDebugSettings

如果 null,系統不會使用任何偵錯設定。

setConsentSyncId

@CanIgnoreReturnValue
public ConsentRequestParameters.Builder setConsentSyncId(String consentSyncId)

設定同意聲明同步 ID,以同步處理使用相同 ID 收集的使用者同意聲明狀態。

同意聲明同步 ID 必須符合下列規定:

  • 建構為 UUID 字串,與規則運算式 (regex) ^[0-9a-zA-Z+.=\/_\-$,{}]{22,150}$ 相符。
  • 最少包含 22 個字元。
  • 最多包含 150 個字元。

如未符合規定,系統就不會設定同意聲明同步 ID,且 UMP SDK 會在控制台中記錄警告。

setTagForUnderAgeOfConsent

@CanIgnoreReturnValue
public ConsentRequestParameters.Builder setTagForUnderAgeOfConsent(boolean tagForUnderAgeOfConsent)

設定是否將使用者標示為未滿規定年齡。

預設值為 false