广告

广告 ID 库定义了一个接口,用于与在您的应用运行的设备上的系统级广告提供商进行交互。此接口允许您的应用接收一致的广告 ID 值。
最新更新 稳定版 候选发布版 Beta 版 Alpha 版
2023 年 3 月 8 日 - - - 1.0.0-alpha05

声明依赖项

要添加对 Ads 的依赖项,您必须将 Google Maven 仓库添加到您的项目中。阅读Google 的 Maven 仓库以获取更多信息。

在您的应用或模块的 build.gradle 文件中添加所需工件的依赖项

Groovy

dependencies {
    implementation 'androidx.ads:ads-identifier:1.0.0-alpha05'

    // Optional - add if you're using Guava to handle
    // return values of type ListenableFuture.
    implementation 'com.google.guava:guava:28.0-android'
}

Kotlin

dependencies {
    implementation("androidx.ads:ads-identifier:1.0.0-alpha05")

    // Optional - add if you're using Guava to handle
    // return values of type ListenableFuture.
    implementation("com.google.guava:guava:28.0-android")
}

有关依赖项的更多信息,请参阅添加构建依赖项

反馈

您的反馈有助于改进 Jetpack。如果您发现新问题或有改进此库的建议,请告诉我们。在创建新问题之前,请查看此库中的现有问题。您可以通过点击星形按钮为现有问题投票。

创建新问题

有关更多信息,请参阅问题跟踪器文档

版本 1.0.0

版本 1.0.0-alpha05

2023 年 3 月 8 日

androidx.ads:ads-identifier:1.0.0-alpha05androidx.ads:ads-identifier-common:1.0.0-alpha05androidx.ads:ads-identifier-provider:1.0.0-alpha05 已发布。1.0.0-alpha05 版包含这些提交。

API 变更

版本 1.0.0-alpha04

2020 年 1 月 22 日

androidx.ads:ads-identifier:1.0.0-alpha04androidx.ads:ads-identifier-common:1.0.0-alpha04androidx.ads:ads-identifier-provider:1.0.0-alpha04 已发布。1.0.0-alpha04 版包含这些提交

新功能

  • 性能改进。

API 变更

  • AdvertisingIdInfo.getId() 现在直接从 AdvertisingIdProvider 返回广告 ID,因此该 ID 现在可以是任何格式。

版本 1.0.0-alpha03

2019 年 11 月 20 日

androidx.ads:ads-identifier:1.0.0-alpha03androidx.ads:ads-identifier-common:1.0.0-alpha03 已发布。1.0.0-alpha03 版包含这些提交

错误修复

  • 移除了对 Java 8 编程语言的依赖。此库现在面向 Java 7 编程语言。

版本 1.0.0-alpha02

2019 年 9 月 18 日

androidx.ads:ads-identifier:1.0.0-alpha02androidx.ads:ads-identifier-common:1.0.0-alpha02 已发布。1.0.0-alpha02 版包含这些提交

API 变更

  • AdvertisingIdUtils.getAdvertisingIdProviderServices() 的返回类型从 List<ResolveInfo> 更改为 List<ServiceInfo>

错误修复

  • AdvertisingIdNotAvailableException 消息更改为更准确地显示“无可用的兼容 AndroidX Advertising ID 提供商。”

版本 1.0.0-alpha01

2019 年 8 月 7 日

androidx.ads:ads-identifier:1.0.0-alpha01androidx.ads:ads-identifier-common:1.0.0-alpha01androidx.ads:ads-identifier-provider:1.0.0-alpha01 已发布。此版本中包含的提交可在此处找到。