广告

广告 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")
}

如需详细了解依赖项,请参阅添加 build 依赖项

反馈

您的反馈将帮助我们改进 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 中包含这些提交内容

bug 修复

  • 移除了对 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>

bug 修复

  • 更改了 AdvertisingIdNotAvailableException 消息,以便更准确地显示“没有兼容的 AndroidX 广告 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。点击此处可查看此版本中包含的提交内容。