IDFA 支持(仅限 iOS)
本指南介绍了通过 UMP SDK 支持 IDFA 消息的操作步骤。本指南应与使用入门搭配使用,后者概述了如何在您的应用中运行 UMP SDK,还介绍了一些关于设置消息的基础知识。本指南仅适用于 IDFA 消息。
前提条件
更新 Info.plist
如果您计划通过 UMP SDK 满足 Apple 的应用跟踪透明度 (ATT) 要求,请确保您已在 Ad Manager 界面中创建、配置并发布 IDFA 铺垫消息。
如需让 UMP SDK 在 iOS 系统对话框中显示自定义提醒消息,请更新 Info.plist
以添加通过自定义消息字符串说明使用情况的 NSUserTrackingUsageDescription
键。
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
显示用户意见征求表单时,该使用情况说明会作为 ATT 对话框的一部分向用户显示:

然后,关联 AppTrackingTransparency
框架:

您的应用现在会在 IDFA ATT 对话框之前显示一条 IDFA 铺垫消息。
测试
进行测试时请注意,requestTrackingAuthorization
是一次性请求,因此 IDFA ATT 对话框只显示一次。UMP SDK 仅在授权状态为 ATTrackingManagerAuthorizationStatusNotDetermined
时提供可加载的表单。
如需使“提醒”再次显示,您必须在测试设备上卸载您的应用后重新安装。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-25。
[null,null,["最后更新时间 (UTC):2025-02-25。"],[[["This 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."],["Before starting, ensure you have completed the UMP SDK setup and created an IDFA message in Google Ad Manager."],["Update your app's `Info.plist` file to include the `NSUserTrackingUsageDescription` key with a custom message explaining your data usage for personalized ads, which will be displayed in the ATT dialog."],["Link the `AppTrackingTransparency` framework to enable the display of an IDFA explainer message before the ATT dialog appears."],["For testing, remember the ATT dialog appears only once; reinstall the app to see it again after the initial authorization."]]],["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"]]