// Create a UMPRequestParameters object.letparameters=UMPRequestParameters()// Indicate the user is under age of consent.parameters.tagForUnderAgeOfConsent=true// Request an update for the consent information.UMPConsentInformation.sharedInstance.requestConsentInfoUpdate(with:parameters){[weakself]requestConsentErroringuardletselfelse{return}// ...}
Objective-C
// Create a UMPRequestParameters object.UMPRequestParameters*parameters=[[UMPRequestParametersalloc]init];// Indicate the user is under age of consent.parameters.tagForUnderAgeOfConsent=YES;// Request an update for the consent information.[UMPConsentInformation.sharedInstancerequestConsentInfoUpdateWithParameters:parameterscompletionHandler:^(NSError*_NullablerequestConsentError){// ...}];
[null,null,["最后更新时间 (UTC):2025-02-08。"],[[["This guide explains how to integrate the US states regulations message into your iOS app using the User Messaging Platform (UMP) SDK."],["Before starting, update to the latest UMP SDK, complete the Get Started guide, create a US states regulations message, and review available message types for potential interactions."],["Use the `tagForUnderAgeOfConsent` parameter to indicate users under the age of consent and ensure compliance with COPPA and other regulations."],["Access user consent choices after they interact with the message by reading from local storage according to the Global Privacy Platform (GPP) specifications."],["Test your implementation using the `debugGeography` setting in the UMP SDK to simulate being in a regulated US state or to suppress the messages."]]],["To support US states regulations, update to UMP SDK 2.1.0+ and complete the \"Get Started\" guide. Create a US states regulations message, and implement a privacy options entry point. For users under the age of consent, set `tagForUnderAgeOfConsent` to `true` in `UMPRequestParameters`, noting that this tag needs to be set on ad requests as well. After a user's decision, read their choice via the Global Privacy Platform spec. Test using `UMPDebugGeographyRegulatedUSState` (v2.7.0+) to simulate a regulated US state.\n"]]