日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Android >内容正文

Android

【Google Play】声明广告权限 ( you must declare the AD_ID Permission when your app targets Android 13 )

發(fā)布時間:2025/6/17 Android 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Google Play】声明广告权限 ( you must declare the AD_ID Permission when your app targets Android 13 ) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

文章目錄

  • 一、廣告權(quán)限申請要求
  • 二、添加廣告權(quán)限





一、廣告權(quán)限申請要求



今天收到 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.

機翻內(nèi)容 ( 僅做參考 ) :

你好,谷歌游戲開發(fā)者,
去年7月,我們宣布改變廣告政策,以幫助加強安全和隱私。我們對針對兒童的應(yīng)用程序使用的標識符增加了新的限制。
當(dāng)用戶選擇刪除他們的廣告ID以退出個性化廣告時,如果開發(fā)者試圖訪問標識符,他們將收到一個由零組成的字符串,而不是標識符。這種行為將從2022年4月1日起擴展到手機、平板電腦和安卓電視。
我們還宣布,當(dāng)您將應(yīng)用程序目標API級別更新為31(Android 12)時,您需要聲明AD_ID權(quán)限。今天,我們分享我們將給開發(fā)者更多的時間來簡化過渡。當(dāng)你的應(yīng)用能夠以安卓13為目標,而不是以安卓12為起點時,我們將需要此權(quán)限聲明。
行動項目
如果你使用廣告ID,當(dāng)你的應(yīng)用針對Android 13或更高版本時,你必須聲明廣告ID權(quán)限。未聲明權(quán)限的應(yīng)用程序?qū)⒌玫揭淮?。?#xff1a;今年晚些時候,你將能夠瞄準Android 13。
如果你的應(yīng)用程序使用的SDK已經(jīng)聲明了Ad ID權(quán)限,它將通過清單合并獲取權(quán)限聲明。
如果你的應(yīng)用程序的目標受眾包括兒童,你不能從兒童或未知年齡的用戶那里傳輸Android廣告ID(AAID)。了解更多。





二、添加廣告權(quán)限



對應(yīng)的文檔地址 : https://support.google.com/googleplay/android-developer/answer/6048248

在 AndroidManifest.xml 中聲明

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

權(quán)限即可 ;

完整清單文件參考 :

<?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' }

總結(jié)

以上是生活随笔為你收集整理的【Google Play】声明广告权限 ( you must declare the AD_ID Permission when your app targets Android 13 )的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。