Compatibilidad con IDFA (solo para iOS)
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Selecciona la plataforma:
iOS
Flutter
El SDK de User Messaging Platform (UMP) te permite presentar un mensaje del IDFA a los usuarios antes de solicitar su consentimiento para la Transparencia en el Seguimiento de Aplicaciones (ATT). El mensaje del IDFA muestra a los usuarios de qué manera utiliza tu app el identificador.
En esta guía, se explica cómo usar el SDK de UMP para presentar un mensaje del IDFA.
Requisitos previos
Antes de comenzar, asegúrate de haber realizado lo siguiente:
Actualiza el archivo Info.plist
Para mostrar un mensaje de alerta personalizado, haz lo siguiente:
- Abre el archivo
Info.plist
.
- Agrega la clave
NSUserTrackingUsageDescription
con un mensaje personalizado que describa el uso:
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>
La descripción del uso aparece como parte de la alerta de ATT sobre el IDFA cuando presentas el formulario de consentimiento:

A continuación, vincula el framework AppTrackingTransparency
:

De esta manera, tu app mostrará un mensaje del IDFA antes de la alerta de ATT.
Prueba
Al hacer pruebas, recuerda que la alerta del ATT solo aparece una vez, ya que requestTrackingAuthorization
es una solicitud única. El SDK de UMP solo tiene un formulario disponible para cargar si el estado de autorización es ATTrackingManagerAuthorizationStatusNotDetermined
.
Para que la alerta aparezca una segunda vez, debes desinstalar y reinstalar tu app en el dispositivo de prueba.
Solicita anuncios con o sin el IDFA
Si un usuario rechaza la ATT, sigue solicitando anuncios con las APIs del formato de anuncios utilizado. El SDK de anuncios de Google para dispositivos móviles no envía el IDFA en la solicitud de anuncio. Para obtener más detalles, consulta Selecciona un formato de anuncios.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-09-06 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-06 (UTC)"],[[["\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,["Select platform: [iOS](/ad-manager/mobile-ads-sdk/ios/privacy/idfa \"View this page for the iOS platform docs.\") [Flutter](/ad-manager/mobile-ads-sdk/flutter/privacy/idfa \"View this page for the Flutter platform docs.\")\n\n\u003cbr /\u003e\n\nThe User Messaging Platform (UMP) SDK lets you present an\n\n[IDFA message](//support.google.com/admanager/answer/10115027)\n\nto your users before requesting their consent for\n[App Tracking Transparency](//developer.apple.com/documentation/apptrackingtransparency)\n(ATT). The IDFA message shows your users how your app uses the identifier.\n\nThis guide covers using the UMP SDK to present an IDFA message.\n| **Note:** If you enable both GDPR and IDFA messages, refer to [Which message your users will\n| see](//support.google.com/admanager/answer/10075998#which-message-your-users-will-see) for the possible outcomes.\n\nPrerequisites\n\nBefore you begin, make sure you've done the following:\n\n- Complete the [Get started guide](/ad-manager/mobile-ads-sdk/flutter/privacy).\n- [Create an IDFA message](//support.google.com/admanager/answer/10116236) in the Ad Manager UI.\n\nUpdate Info.plist\n\nTo show a custom alert message, do the following:\n\n1. Open the `Info.plist` file.\n2. Add the `NSUserTrackingUsageDescription` key with a custom message that describes the usage:\n\n \u003ckey\u003eNSUserTrackingUsageDescription\u003c/key\u003e\n \u003cstring\u003eThis identifier will be used to deliver personalized ads to you.\u003c/string\u003e\n\nThe usage description appears as part of the IDFA ATT alert when you present the\nconsent form:\n\nThen, link the `AppTrackingTransparency` framework:\n\nYour app then shows an IDFA message before the ATT alert.\n\nTesting\n\nWhile testing, remember that the ATT alert only appears a single time since\n[`requestTrackingAuthorization`](//developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorization)\nis a one-time request. The UMP SDK only has a form available to load if the\nauthorization status is\n[`ATTrackingManagerAuthorizationStatusNotDetermined`](//developer.apple.com/documentation/apptrackingtransparency/attrackingmanagerauthorizationstatus/attrackingmanagerauthorizationstatusnotdetermined?language=objc).\n\nTo make the alert appear a second time, you must uninstall and reinstall your\napp on your test device.\n\nRequest ads with or without IDFA\n\nIf a user denies ATT, continue to request ads using your ad format's APIs. The\nGoogle Mobile Ads SDK doesn't send IDFA in the ad request. For more details see,\n[Select an ad format](/ad-manager/mobile-ads-sdk/flutter/quick-start#select_an_ad_format)."]]