GoogleUserMessagingPlatform Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
@interface UMPConsentInformation : NSObject
Consent information. All methods must be called on the main thread.
-
The shared consent information instance.
Declaration
Swift
class var shared: ConsentInformation { get }
Objective-C
@property (class, nonatomic, readonly, nonnull) UMPConsentInformation *sharedInstance;
-
The user’s consent status. This value defaults to UMPConsentStatusUnknown until
requestConsentInfoUpdateWithParameters:completionHandler: is called, and defaults to the
previous session’s value until |completionHandler| from
requestConsentInfoUpdateWithParameters:completionHandler: is called.
Declaration
Swift
var consentStatus: ConsentStatus { get }
-
Indicates whether the SDK has gathered consent aligned with the app’s configured messages.
Returns NO until requestConsentInfoUpdateWithParameters:completionHandler: is called.
Declaration
Swift
var canRequestAds: Bool { get }
Objective-C
@property (nonatomic, readonly) BOOL canRequestAds;
-
Consent form status. This value defaults to UMPFormStatusUnknown and requires a call to
requestConsentInfoUpdateWithParameters:completionHandler: to update.
Declaration
Swift
var formStatus: FormStatus { get }
Objective-C
@property (nonatomic, readonly) UMPFormStatus formStatus;
-
Privacy options requirement status. This value defaults to
UMPPrivacyOptionsRequirementStatusUnknown until
requestConsentInfoUpdateWithParameters:completionHandler: is called, and defaults to the
previous session’s value until |completionHandler| from
requestConsentInfoUpdateWithParameters:completionHandler: is called.
Declaration
Swift
var privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus { get }
-
Requests consent information update. Must be called in every app session before checking the
user’s consentStatus or loading a consent form. After calling this method, consentStatus will be
updated synchronously to hold the consent state from the previous app session, if one exists.
consentStatus may be updated again immediately before the completion handler is called.
Declaration
Swift
func requestConsentInfoUpdate(with parameters: RequestParameters?) async throws
-
Clears all consent state from persistent storage.
Declaration
Objective-C
- (void)reset;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eUMPConsentInformation\u003c/code\u003e provides methods to manage user consent, including status, form status, and privacy options requirement status.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003erequestConsentInfoUpdateWithParameters:completionHandler:\u003c/code\u003e should be called in every app session before interacting with user consent or loading a consent form.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003econsentStatus\u003c/code\u003e, \u003ccode\u003ecanRequestAds\u003c/code\u003e, \u003ccode\u003eformStatus\u003c/code\u003e, and \u003ccode\u003eprivacyOptionsRequirementStatus\u003c/code\u003e reflect the current consent information and status.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esharedInstance\u003c/code\u003e gives access to the single, shared instance of the \u003ccode\u003eUMPConsentInformation\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ereset\u003c/code\u003e method clears all stored consent data.\u003c/p\u003e\n"]]],["The `UMPConsentInformation` class manages user consent. Key actions include: obtaining a shared instance, calling `requestConsentInfoUpdateWithParameters:completionHandler:` to update the `consentStatus`, `formStatus`, and `privacyOptionsRequirementStatus`, which are initially unknown. `canRequestAds` indicates if consent aligns with messages and returns NO until consent info is updated. This method is crucial in each app session before checking consent or loading a form. `reset` clears all stored consent data. All actions must be on the main thread.\n"],null,["# GoogleUserMessagingPlatform Framework Reference\n\nUMPConsentInformation\n=====================\n\n\n @interface UMPConsentInformation : NSObject\n\nConsent information. All methods must be called on the main thread.\n- `\n ``\n ``\n `\n\n ### [sharedInstance](#/c:objc(cs)UMPConsentInformation(cpy)sharedInstance)\n\n `\n ` \n The shared consent information instance. \n\n #### Declaration\n\n Swift \n\n class var shared: ConsentInformation { get }\n\n Objective-C \n\n @property (class, nonatomic, readonly, nonnull) UMPConsentInformation *sharedInstance;\n\n- `\n ``\n ``\n `\n\n ### [consentStatus](#/c:objc(cs)UMPConsentInformation(py)consentStatus)\n\n `\n ` \n The user's consent status. This value defaults to UMPConsentStatusUnknown until\n requestConsentInfoUpdateWithParameters:completionHandler: is called, and defaults to the\n previous session's value until \\|completionHandler\\| from\n requestConsentInfoUpdateWithParameters:completionHandler: is called. \n\n #### Declaration\n\n Swift \n\n var consentStatus: ConsentStatus { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Enums/UMPConsentStatus.html consentStatus;\n\n- `\n ``\n ``\n `\n\n ### [canRequestAds](#/c:objc(cs)UMPConsentInformation(py)canRequestAds)\n\n `\n ` \n Indicates whether the SDK has gathered consent aligned with the app's configured messages.\n Returns NO until requestConsentInfoUpdateWithParameters:completionHandler: is called. \n\n #### Declaration\n\n Swift \n\n var canRequestAds: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL canRequestAds;\n\n- `\n ``\n ``\n `\n\n ### [formStatus](#/c:objc(cs)UMPConsentInformation(py)formStatus)\n\n `\n ` \n Consent form status. This value defaults to UMPFormStatusUnknown and requires a call to\n requestConsentInfoUpdateWithParameters:completionHandler: to update. \n\n #### Declaration\n\n Swift \n\n var formStatus: FormStatus { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Enums/UMPFormStatus.html formStatus;\n\n- `\n ``\n ``\n `\n\n ### [privacyOptionsRequirementStatus](#/c:objc(cs)UMPConsentInformation(py)privacyOptionsRequirementStatus)\n\n `\n ` \n Privacy options requirement status. This value defaults to\n UMPPrivacyOptionsRequirementStatusUnknown until\n requestConsentInfoUpdateWithParameters:completionHandler: is called, and defaults to the\n previous session's value until \\|completionHandler\\| from\n requestConsentInfoUpdateWithParameters:completionHandler: is called. \n\n #### Declaration\n\n Swift \n\n var privacyOptionsRequirementStatus: PrivacyOptionsRequirementStatus { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Enums/UMPPrivacyOptionsRequirementStatus.html privacyOptionsRequirementStatus;\n\n- `\n ``\n ``\n `\n\n ### [-requestConsentInfoUpdateWithParameters:completionHandler:](#/c:objc(cs)UMPConsentInformation(im)requestConsentInfoUpdateWithParameters:completionHandler:)\n\n `\n ` \n Requests consent information update. Must be called in every app session before checking the\n user's consentStatus or loading a consent form. After calling this method, consentStatus will be\n updated synchronously to hold the consent state from the previous app session, if one exists.\n consentStatus may be updated again immediately before the completion handler is called. \n\n #### Declaration\n\n Swift \n\n func requestConsentInfoUpdate(with parameters: RequestParameters?) async throws\n\n Objective-C \n\n - (void)\n requestConsentInfoUpdateWithParameters:\n (nullable ../Classes/UMPRequestParameters.html *)parameters\n completionHandler:\n (nonnull\n ../Type-Definitions.html#/c:UMPConsentInformation.h@T@UMPConsentInformationUpdateCompletionHandler)\n handler;\n\n- `\n ``\n ``\n `\n\n ### [-reset](#/c:objc(cs)UMPConsentInformation(im)reset)\n\n `\n ` \n Clears all consent state from persistent storage. \n\n #### Declaration\n\n Swift \n\n func reset()\n\n Objective-C \n\n - (void)reset;"]]