【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"/><applicationandroid: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 30buildToolsVersion "30.0.3"defaultConfig {applicationId "com.example.ad_id_test"minSdkVersion 18targetSdkVersion 31versionCode 1versionName "1.0"testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"}buildTypes {release {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'}}compileOptions {sourceCompatibility JavaVersion.VERSION_1_8targetCompatibility 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' }總結
以上是生活随笔為你收集整理的【Google Play】声明广告权限 ( you must declare the AD_ID Permission when your app targets Android 13 )的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【数字信号处理】傅里叶变换性质 ( 序列
- 下一篇: 【数字信号处理】傅里叶变换性质 ( 序列