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