IDFA 支持
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本指南介绍了通过 UMP SDK 支持 IDFA 消息的操作步骤。本指南应与使用入门搭配使用,后者概述了如何在您的应用中运行 UMP SDK,还介绍了一些关于设置消息的基础知识。本指南仅适用于 IDFA 消息。
前提条件
更新 Info.plist
如果您计划通过 UMP SDK 满足 Apple 的应用跟踪透明度 (ATT) 要求,请确保您已在 AdMob 界面中创建、配置并发布 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-08。
[[["易于理解","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-02-08。"],[[["This guide provides steps to integrate the IDFA message within the User Messaging Platform (UMP) SDK for iOS apps."],["Before proceeding, complete the UMP SDK setup and create an IDFA message in AdMob."],["Update your app's `Info.plist` with `NSUserTrackingUsageDescription` to present a custom message within Apple's App Tracking Transparency dialog."],["Remember to link the `AppTrackingTransparency` framework to display the IDFA explainer message before the ATT dialog."],["For testing, reinstall the app to reset the IDFA authorization status and see the dialog again."]]],[]]