已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入

AdSelectionConfig.Builder

public static final class AdSelectionConfig.Builder
extends Object

java.lang.Object
   ↳ android.adservices.adselection.AdSelectionConfig.Builder


AdSelectionConfig 对象的构建器。

摘要

公共构造函数

Builder()

公共方法

AdSelectionConfig build()

构建 AdSelectionConfig 实例。

AdSelectionConfig.Builder setAdSelectionSignals(AdSelectionSignals adSelectionSignals)

设置在广告选择出价生成期间向买方提供的信号。

AdSelectionConfig.Builder setCustomAudienceBuyers(List<AdTechIdentifier> customAudienceBuyers)

设置允许的买方列表。

AdSelectionConfig.Builder setDecisionLogicUri(Uri decisionLogicUri)

设置用于提取决策逻辑以用于广告选择流程的 URI。

AdSelectionConfig.Builder setPerBuyerSignals(Map<AdTechIdentifierAdSelectionSignals> perBuyerSignals)

设置每个买方在广告选择期间提供的信号。

AdSelectionConfig.Builder setSeller(AdTechIdentifier seller)

设置卖方标识符。

AdSelectionConfig.Builder setSellerSignals(AdSelectionSignals sellerSignals)

设置用于修改广告选择结果的信号。

AdSelectionConfig.Builder setTrustedScoringSignalsUri(Uri trustedScoringSignalsUri)

设置卖方可信信号的 URI 端点,该信号可实时从这些信号中 可提取的信息。

继承的方法

Object clone()

创建并返回此对象的副本。

boolean equals(Object obj)

指示某个其他对象是否“等于”这个。

void finalize()

垃圾回收时,由垃圾回收器针对对象调用 确定没有对对象的更多引用。

final Class<?> getClass()

返回此 Object 的运行时类。

int hashCode()

返回对象的哈希代码值。

final void notify()

唤醒正在等待此对象的 监控。

final void notifyAll()

唤醒正在等待此对象的监控器的所有线程。

String toString()

返回对象的字符串表示。

final void wait(long timeoutMillis, int nanos)

导致当前线程处于等待状态,直到其被唤醒,这通常是 通知中断,或者直到 经过了一定量的实时。

final void wait(long timeoutMillis)

导致当前线程处于等待状态,直到其被唤醒,这通常是 通知中断,或者直到 经过了一定量的实时。

final void wait()

导致当前线程处于等待状态,直到其被唤醒,这通常是 通知中断

公共构造函数

Builder

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public Builder ()

公共方法

build

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig build ()

构建 AdSelectionConfig 实例。

返回
AdSelectionConfig 此值不能为 null

抛出
NullPointerException 如果任何必需参数为 null

setAdSelectionSignals

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setAdSelectionSignals (AdSelectionSignals adSelectionSignals)

设置在广告选择出价生成期间向买方提供的信号。

如果未设置,则默认为空 JSON。

如需了解详情,请参阅 AdSelectionConfig.getAdSelectionSignals()

参数
adSelectionSignals AdSelectionSignals:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null

setCustomAudienceBuyers

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setCustomAudienceBuyers (List<AdTechIdentifier> customAudienceBuyers)

设置允许的买方列表。

如需了解详情,请参阅 AdSelectionConfig.getCustomAudienceBuyers()

参数
customAudienceBuyers List:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null

setDecisionLogicUri

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setDecisionLogicUri (Uri decisionLogicUri)

设置用于提取决策逻辑以用于广告选择流程的 URI。判定 URI 可以是以下两种架构之一:

  • HTTPS:HTTPS URI 必须是绝对 URI,其中主机与 seller 匹配
  • 广告选择预构建:广告选择服务 URI 遵循 ad-selection-prebuilt://ad-selection/<name>?<script-generation-parameters> 格式。 FLEDGE 无需调用网络即可生成相应的 JS 脚本。

    可用的预构建脚本:

    • highest-bid-wins(针对 scoreAdsreportResult:此 JS 会选择出价最高的广告进行评分。对于 系统会使用 render_uribid 参数化给定 URI。如需使用此预构建版本,您需要提供以下参数: <ph type="x-smartling-placeholder">
        </ph>
      • reportingUrl:将创建的基础报告 URI 稍后使用 render_uribid 参数化

      例如:如果您的基本报告网址为“https://www.ssp.com”之后,ad-selection-prebuilt://ad-selection/highest-bid-wins/?reportingUrl=https://www.ssp.com

如需了解详情,请参阅 AdSelectionConfig.getDecisionLogicUri()

参数
decisionLogicUri Uri:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null

setPerBuyerSignals

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setPerBuyerSignals (Map<AdTechIdentifierAdSelectionSignals> perBuyerSignals)

设置每个买方在广告选择期间提供的信号。

如果未设置,则默认为空映射。

如需了解详情,请参阅 AdSelectionConfig.getPerBuyerSignals()

参数
perBuyerSignals Map:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null

setSeller

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setSeller (AdTechIdentifier seller)

设置卖方标识符。

如需了解详情,请参阅 AdSelectionConfig.getSeller()

参数
seller AdTechIdentifier:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null

setSellerSignals

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setSellerSignals (AdSelectionSignals sellerSignals)

设置用于修改广告选择结果的信号。

如果未设置,则默认为空 JSON。

如需了解详情,请参阅 AdSelectionConfig.getSellerSignals()

参数
sellerSignals AdSelectionSignals:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null

setTrustedScoringSignalsUri

已在 API 级别 34 中引入
也已在广告服务扩展 4 中引入
public AdSelectionConfig.Builder setTrustedScoringSignalsUri (Uri trustedScoringSignalsUri)

设置卖方可信信号的 URI 端点,该信号可实时从这些信号中 可提取的信息。

如果传递了 Uri#EMPTY,则会跳过网络调用,并将 AdSelectionSignals.EMPTY 传递给广告选择。

如需了解详情,请参阅 AdSelectionConfig.getTrustedScoringSignalsUri()

参数
trustedScoringSignalsUri Uri:此值不能为 null

返回值
AdSelectionConfig.Builder 此值不能为 null