【Google Play】声明广告权限 ( you must declare the AD_ID Permission when your app targets Android 13 )
文章目录
一、广告权限申请要求
今天收到 Google Play 邮件 , 要求添加
邮件原文 :
Hello Google Play Developer,
Last July, we announced Advertising policy changes to help bolster security and privacy. We added new restrictions on identifiers used by apps that target children.
When users choose to delete their advertising ID in order to opt out of personalization advertising, developers will receive a string of zeros instead of the identifier if they attempt to access the identifier. This behavior will extend to phones, tablets, and Android TV starting April 1, 2022.
We also announced that you need to declare an AD_ID permission when you update your app targeting API level to 31 (Android 12). Today, we are sharing that we will give developers more time to ease the transition. We will require this permission declaration when your apps are able to target Android 13 instead of starting with Android 12.
Action Items
If you use an advertising ID, you must declare the AD_ID Permission when your app targets Android 13 or above. Apps that don’t declare the permission will get a string of zeros. Note: You’ll be able to target Android 13 later this year.
If your app uses an SDK that has declared the Ad ID permission, it will acquire the permission declaration through manifest merge.
If your app’s target audience includes children, you must not transmit Android Advertising ID (AAID) from children or users of unknown age. Learn more.
机翻内容 ( 仅做参考 ) :
你好,谷歌游戏开发者,
去年7月,我们宣布改变广告政策,以帮助加强安全和隐私。我们对针对儿童的应用程序使用的标识符增加了新的限制。
当用户选择删除他们的广告ID以退出个性化广告时,如果开发者试图访问标识符,他们将收到一个由零组成的字符串,而不是标识符。这种行为将从2022年4月1日起扩展到手机、平板电脑和安卓电视。
我们还宣布,当您将应用程序目标API级别更新为31(Android 12)时,您需要声明AD_ID权限。今天,我们分享我们将给开发者更多的时间来简化过渡。当你的应用能够以安卓13为目标,而不是以安卓12为起点时,我们将需要此权限声明。
行动项目
如果你使用广告ID,当你的应用针对Android 13或更高版本时,你必须声明广告ID权限。未声明权限的应用程序将得到一串零。注:今年晚些时候,你将能够瞄准Android 13。
如果你的应用程序使用的SDK已经声明了Ad ID权限,它将通过清单合并获取权限声明。
如果你的应用程序的目标受众包括儿童,你不能从儿童或未知年龄的用户那里传输Android广告ID(AAID)。了解更多。
二、添加广告权限
对应的文档地址 : https://support.google.com/googleplay/android-developer/answer/6048248
在 AndroidManifest.xml 中声明
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
权限即可 ;
完整清单文件参考 :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ad_id_test">
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AD_ID_Test">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
完整 build.gradle 参考 : 核心是 targetSdkVersion 31
;
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.ad_id_test"
minSdkVersion 18
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
相关文章
- Android的so注入( inject)和函数Hook(基于got表) - 支持arm和x86
- 将Android源码导入eclipse中的方法以及编译Android源码指定模块
- Android最新敲诈者病毒分析及解锁
- Android性能优化Google课程翻译一:Render----OverDraw实战
- Android Bander设计与实现 - 设计篇
- Android应用性能优化最佳实践.
- android反编译工具 ApkDec-Release-0.1
- 《Android应用开发入门经典(第3版)》——第6.7节问与答
- 《Android开发秘籍(第2版)》——第1.8节Google Play
- android adb常用指令
- android EventBus的简单使用
- Android中连接蓝牙设备时遇到createRfcommSocketToServiceRecord的UUID问题和BluetoothSocket的connect失败
- Android Animation学习(一) Property Animation介绍
- Android应用程序的Activity启动过程简要介绍和学习计划
- android webview type=file文件上传,安卓端代码
- Android 应用换肤方案的总结
- 金九银十必备!大厂面试官编写938页Android实战总结笔记
- Android几行代码实现实时监听微信聊天
- 【AGC】关于华为AGC android Gradle8.0适配问题
- Android视图重绘,使用invalidate还是requestLayout
- Android 蓝牙通信——AndroidBluetoothManager
- 图解Oracle诉Google Android对Java的巨额侵权案