این راهنما مراحل مورد نیاز برای پشتیبانی از پیام مقررات ایالت های ایالات متحده را به عنوان بخشی از UMP SDK تشریح می کند. این دستورالعملها را با Get Start جفت کنید، که نحوه اجرای برنامه خود را با UMP SDK و تنظیم پیام خود توضیح میدهد. راهنمایی زیر مختص پیام مقررات ایالت های ایالات متحده است.
پیش نیازها
قبل از ادامه، مطمئن شوید که موارد زیر را انجام داده اید:
به آخرین نسخه UMP SDK به روز رسانی کنید. برای پشتیبانی از پیامرسانی مقررات ایالات متحده، توصیه میکنیم از نسخه 2.1.0 یا بالاتر استفاده کنید.
کامل شروع کنید . حتماً یک نقطه ورودی گزینه های حریم خصوصی را پیاده سازی کنید و در صورت لزوم آن را رندر کنید. با تکمیل این راهنما، شما یک نقطه ورودی برای ارائه پیام مقررات ایالت های ایالات متحده به کاربران خود دارید.
اگر از پیام مقررات ایالتهای ایالات متحده در کنار پیامهای دیگر استفاده میکنید، با انواع پیامهای کاربر موجود مشورت کنید تا متوجه شوید چه زمانی پیامهای مختلف برای کاربران شما نمایش داده میشود.
برچسب را برای زیر سن رضایت تنظیم کنید
برای نشان دادن اینکه آیا کاربر زیر سن رضایت است یا خیر، setTagForUnderAgeOfConsent (TFUA) را تنظیم کنید. وقتی TFUA را روی true تنظیم میکنید، UMP SDK رضایت کاربر را درخواست نمیکند. اگر برنامه شما مخاطبان مختلفی دارد، این پارامتر را برای کاربران کودک تنظیم کنید تا اطمینان حاصل کنید که رضایت شما درخواست نشده است. مسئولیت تنظیم این پارامتر در صورت لزوم برای مطابقت با COPPA و سایر مقررات مربوط به عهده شماست.
مثال زیر TFUA را در یک درخواست رضایت UMP روی true تنظیم می کند:
جاوا
ConsentRequestParametersparams=newConsentRequestParameters.Builder()// Indicate the user is under age of consent..setTagForUnderAgeOfConsent(true).build();consentInformation=UserMessagingPlatform.getConsentInformation(this);consentInformation.requestConsentInfoUpdate(this,params,(OnConsentInfoUpdateSuccessListener)()->{// ...},(OnConsentInfoUpdateFailureListener)requestConsentError->{// ...});
کاتلین
valparams=ConsentRequestParameters.Builder()// Indicate the user is under age of consent..setTagForUnderAgeOfConsent(true).build()consentInformation=UserMessagingPlatform.getConsentInformation(this)consentInformation.requestConsentInfoUpdate(this,params,ConsentInformation.OnConsentInfoUpdateSuccessListener{// ...},ConsentInformation.OnConsentInfoUpdateFailureListener{requestConsentError->
// ...})
گزینه های رضایت را بخوانید
پس از اینکه کاربر تصمیم مقررات ایالت های ایالات متحده را گرفت، می توانید انتخاب او را از فضای ذخیره سازی محلی با توجه به مشخصات پلت فرم حریم خصوصی جهانی (GPP) بخوانید. برای جزئیات بیشتر به جزئیات درون برنامه مراجعه کنید. توجه داشته باشید که UMP SDK فقط کلیدهای IABGPP_GppSID و IABGPP_HDR_GppString را پر می کند.
پیام های مقررات ایالت های ایالات متحده را آزمایش کنید
برای آزمایش پیامهای مقررات ایالتهای ایالات متحده، از UMPDebugGeographyRegulatedUSStatedebugGeography استفاده کنید تا UMP SDK را مجبور کنید با دستگاه آزمایشی شما طوری رفتار کند که گویی دستگاه در یک ایالت تحت نظارت ایالات متحده واقع شده است. همچنین می توانید از UMPDebugGeographyOther برای سرکوب پیام های مقررات ایالت های ایالات متحده استفاده کنید. برای جزئیات بیشتر در مورد debugGeography ، به اجبار یک جغرافیا مراجعه کنید.
تاریخ آخرین بهروزرسانی 2025-09-02 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-09-02 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis guide helps you implement the US state regulations message within your Android app using the User Messaging Platform (UMP) SDK.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, update to the latest UMP SDK (version 2.1.0 or higher), complete the basic UMP setup, create a US state regulations message in Ad Manager, and review message display priorities.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003esetTagForUnderAgeOfConsent(true)\u003c/code\u003e to indicate users under the age of consent (TFUA) and prevent consent requests for them, ensuring compliance with COPPA and other regulations.\u003c/p\u003e\n"],["\u003cp\u003eAfter user interaction, access their choices from local storage using the Global Privacy Platform (GPP) spec, focusing on \u003ccode\u003eIABGPP_GppSID\u003c/code\u003e and \u003ccode\u003eIABGPP_HDR_GppString\u003c/code\u003e keys.\u003c/p\u003e\n"],["\u003cp\u003eFor testing, use the \u003ccode\u003eUMPDebugGeographyRegulatedUSState\u003c/code\u003e debugGeography to simulate a device located in a regulated US state (available in UMP SDK version 3.1.0 or higher).\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/ad-manager/mobile-ads-sdk/android/privacy/us-iab-support \"View this page for the Android platform docs.\") [iOS](/ad-manager/mobile-ads-sdk/ios/privacy/us-iab-support \"View this page for the iOS platform docs.\") [Unity](/ad-manager/mobile-ads-sdk/unity/privacy/us-iab-support \"View this page for the Unity platform docs.\")\n\n\u003cbr /\u003e\n\nThis guide outlines the steps required to support the US states regulations\nmessage as part of the UMP SDK. Pair these instructions with\n[Get started](/ad-manager/mobile-ads-sdk/android/privacy), which details how to get your app running\nwith the UMP SDK and set up your message. The following guidance is specific to\nthe US states regulations message.\n\nPrerequisites\n\nBefore continuing, ensure you do the following:\n\n- Update to the latest version of the UMP SDK. For US states regulations messaging support, we recommend you to use version 2.1.0 or higher.\n- Complete [Get started](/ad-manager/mobile-ads-sdk/android/privacy). Be sure to implement a privacy options entrypoint and render it if required. By completing this guide, you have an entrypoint to serve your US states regulations message to your users.\n- [Create a US state regulations message](//support.google.com/admanager/answer/10115735) for apps.\n- If you're using the US states regulations message alongside other messages, consult [Available user message types](//support.google.com/admanager/answer/10075998) to understand when different messages are displayed to your users.\n\nSet the tag for under age of consent\n\nTo indicate whether a user is under the age of consent, set\n`\n`[setTagForUnderAgeOfConsent](/ad-manager/mobile-ads-sdk/android/privacy/api/reference/com/google/android/ump/ConsentRequestParameters.Builder#public-consentrequestparameters.builder-settagforunderageofconsent-boolean-tagforunderageofconsent) (TFUA). When you set TFUA to `true`, the UMP SDK\ndoesn't request consent from the user. If your app has a mixed audience, set\nthis parameter for child users to ensure consent is not requested.\nIt is your\nresponsibility for setting this parameter where necessary to comply with COPPA\nand other relevant regulations.\n| **Important:** The UMP SDK does not forward the TFUA tag set on consent requests to the Google Mobile Ads SDK. You must explicitly set the `tagForUnderAgeOfConsent` or `tagForChildDirectectedTreatment` on ad requests. If you don't set the `tagForUnderAgeOfConsent` or `tagForChildDirectectedTreatment` on ad requests, the UMP SDK does not collect any information that allows Google to determine whether or not users under the age of consent use your app. For more information about data processing restrictions for these users, see [Tag an ad request for child-directed treatment](//support.google.com/admanager/answer/3671211).\n\nThe following example sets TFUA to true on a UMP consent request: \n\nJava \n\n ConsentRequestParameters params = new ConsentRequestParameters\n .Builder()\n // Indicate the user is under age of consent.\n .setTagForUnderAgeOfConsent(true)\n .build();\n\n consentInformation = UserMessagingPlatform.getConsentInformation(this);\n consentInformation.requestConsentInfoUpdate(\n this,\n params,\n (OnConsentInfoUpdateSuccessListener) () -\u003e {\n // ...\n },\n (OnConsentInfoUpdateFailureListener) requestConsentError -\u003e {\n // ...\n });\n\nKotlin \n\n val params = ConsentRequestParameters\n .Builder()\n // Indicate the user is under age of consent.\n .setTagForUnderAgeOfConsent(true)\n .build()\n\n consentInformation = UserMessagingPlatform.getConsentInformation(this)\n consentInformation.requestConsentInfoUpdate(\n this,\n params,\n ConsentInformation.OnConsentInfoUpdateSuccessListener {\n // ...\n },\n ConsentInformation.OnConsentInfoUpdateFailureListener {\n requestConsentError -\u003e\n // ...\n })\n\nRead consent choices\n\nAfter the user has made a US states regulations decision, you can read\ntheir choice from local storage following the Global Privacy Platform (GPP)\nspec. For more details see,\n[In-App Details](https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform/blob/main/Core/CMP%20API%20Specification.md#in-app-details).\nNote that the UMP SDK only populates the `IABGPP_GppSID` and\n`IABGPP_HDR_GppString` keys.\n\nTest your US states regulations messaging\n\nTo test your US states regulations messaging, use the\n`UMPDebugGeographyRegulatedUSState` `debugGeography` to force the UMP\nSDK to treat your test device as if the device were located in a regulated US\nstate. You can also use `UMPDebugGeographyOther` to force suppression of US\nstates regulations messages. For more details on `debugGeography`, see\n[Force a geography](/ad-manager/mobile-ads-sdk/android/privacy#force_a_geography).\n| **Note:** `UMPDebugGeographyRegulatedUSState` is only available in UMP version 3.1.0 or higher."]]