Google 广告ID 获取失败 0000-0000

The AD_ID permission

In early 2022, Google announced a change to the behavior of Google Play Services and fetching of the Android Advertising ID. According to the announcement, apps targeting Android 13 (API 33) and above must declare a Google Play services normal permission in their AndroidManifest.xml file in order to get access to the device’s Advertising ID.

在2022年初,谷歌宣布改变谷歌播放服务的行为和获取Android广告ID。根据公告,针对Android 13 (API 33)及以上版本的应用程序必须在其AndroidManifest.xml文件中声明b谷歌Play服务正常权限,以便访问设备的广告ID

<uses-permission android:name="com.google.android.gms.permission.AD_ID" />

Android 13 ( targetSdk 33) 需要添加以上权限

  • If your app participates in the Designed for Families program:
    • If using SDK V6.8.0 and above, you should Revoke the AD_ID permission.
    • If using SDK older than V6.8.0, don't add this permission to your app.
  • For apps that target API level 32 (Android 12L) or older, this permission is not needed.

如果您的应用程序参与了为家庭设计的计划:

如果使用SDK V6.8.0及以上版本,您应该撤销AD_ID权限。(个人理解:使用的三方SDK中包含AD_ID权限,需要移除。

<uses-permission android:name="com.google.android.gms.permission.AD_ID"
    tools:node="remove"/>

如果使用的SDK早于V6.8.0,请不要将此权限添加到应用程序中。

对于API级别为32 (Android 12L)或更早版本的应用程序,不需要此权限。

什么是  Designed for Families 

Google Play offers a rich platform for developers to showcase their high-quality, age appropriate content for the whole family. Before submitting an app to the Designed for Families program or submitting an app that targets children to the Google Play Store, you are responsible for ensuring your app is appropriate for children and compliant with all relevant laws.

谷歌Play为开发者提供了一个丰富的平台,让他们能够向整个家庭展示高质量、适合年龄的内容。在向“家庭设计”项目提交应用程序或向b谷歌Play Store提交针对儿童的应用程序之前,您有责任确保您的应用程序适合儿童并符合所有相关法律。(针对儿童的应用,google商店规则不允许获取广告ID)

补充:

<uses-permission android:name="com.google.android.gms.permission.AD_ID"    tools:node="remove"/>

这行代码是一个在 AndroidManifest.xml 文件中使用的权限声明。它声明了应用程序需要使用 Google Play Services 的广告标识符(Advertising ID)功能,以便应用程序能够向用户提供广告。

tools:node="remove" 属性表示在构建 APK 文件时,这个权限声明将被删除,而不会影响应用程序在运行时的功能。这个属性通常被用于在开发过程中从 Manifest 文件中移除某些权限声明,以便在构建和测试应用程序时,可以快速地测试不同的配置或权限设置,而无需在代码中手动添加或删除权限声明。

需要注意的是,这个属性只能在开发阶段使用,不能在发布应用程序时使用该属性来删除权限声明。在发布应用程序之前,必须确保应用程序包含了需要的所有权限声明,以确保应用程序能够正常工作,并符合 Google Play Store 的发布要求。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值