IDFA 支持(仅限 iOS)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 User Messaging Platform (UMP) SDK,您可以在请求用户同意应用跟踪透明度 (ATT) 之前向用户显示 IDFA 消息。IDFA 消息会向用户说明您的应用如何使用该标识符。
本指南介绍了如何使用 UMP SDK 显示 IDFA 消息。
前提条件
在开始之前,请确保您已完成以下操作:
更新 Info.plist
如需显示自定义提醒消息,请执行以下操作:
- 打开
Info.plist
文件。
- 添加
NSUserTrackingUsageDescription
键,并附上说明使用情况的自定义消息:
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
显示用户意见征求表单时,该使用情况说明会作为 IDFA ATT 提醒的一部分向用户显示:

然后,关联 AppTrackingTransparency
框架:

然后,您的应用会在 ATT 提醒之前显示 IDFA 消息。
测试
进行测试时请注意,requestTrackingAuthorization
是一次性请求,因此 ATT 提醒只显示一次。UMP SDK 仅在授权状态为 ATTrackingManagerAuthorizationStatusNotDetermined
时提供可加载的表单。
如需使“提醒”再次显示,您必须在测试设备上卸载您的应用后重新安装。
请求广告(无论是否带有 IDFA)
如果用户拒绝 ATT,请继续使用广告格式的 API 请求广告。Google 移动广告 SDK 不会在广告请求中发送 IDFA。如需了解详情,请参阅选择广告格式。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-06。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-06。"],[[["\u003cp\u003eThis guide explains how to implement the IDFA message within the User Messaging Platform (UMP) SDK for Flutter apps, specifically for handling Apple's App Tracking Transparency (ATT) requirements.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, ensure you have completed the UMP SDK setup and created an IDFA message in Google Ad Manager.\u003c/p\u003e\n"],["\u003cp\u003eUpdate your app's \u003ccode\u003eInfo.plist\u003c/code\u003e file to include the \u003ccode\u003eNSUserTrackingUsageDescription\u003c/code\u003e key with a custom message explaining your data usage for personalized ads, which will be displayed in the ATT dialog.\u003c/p\u003e\n"],["\u003cp\u003eLink the \u003ccode\u003eAppTrackingTransparency\u003c/code\u003e framework to enable the display of an IDFA explainer message before the ATT dialog appears.\u003c/p\u003e\n"],["\u003cp\u003eFor testing, remember the ATT dialog appears only once; reinstall the app to see it again after the initial authorization.\u003c/p\u003e\n"]]],["To support the IDFA message using the UMP SDK, first complete the \"Get started\" guide and create an IDFA message in Ad Manager. Update the `Info.plist` file by adding the `NSUserTrackingUsageDescription` key with a custom message explaining IDFA usage. Link the `AppTrackingTransparency` framework. During testing, remember the IDFA ATT dialog appears only once unless the app is uninstalled and reinstalled due to the one-time authorization request. The form is available if the authorization status is `ATTrackingManagerAuthorizationStatusNotDetermined`.\n"],null,[]]