【问题标题】:Usage of Google Advertising Id on Android WITHOUT integrating Google Mobile Ads在未集成 Google 移动广告的情况下在 Android 上使用 Google 广告 ID
【发布时间】:2019-04-24 01:45:30
【问题描述】:

在 Android 上获取 Google Advertising ID 需要导入 play-services-ads 依赖项。

从 17.0.0 开始,此依赖项强制应用程序清单包含带有键 com.google.android.gms.ads.APPLICATION_ID<meta-data> 标记。缺少标签会导致应用程序崩溃。

但我想检索与 Google 移动广告无关的广告目的的 Google 广告 ID,并且我没有应用程序 ID。

有谁知道现在该怎么做?

【问题讨论】:

    标签: android google-play-services ads google-advertising-id


    【解决方案1】:

    您可以使用 play-services-ads-identifier 代替 play-services-ads

    implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
    

    这将只导​​入 Advertising ID 类,而不导入 Google Mobile Ads/AdMob。

    【讨论】:

    • 酷,谢谢。我对 16.x 版本的 ads-identifier 有点怀疑(因为此更改是在 17.0.0 的广告中引入的),但 17.x 播放服务广告使用的是完全相同的 16.0.0 版本
    猜你喜欢
    • 1970-01-01
    • 2017-05-01
    • 1970-01-01
    • 2017-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多