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-03-25 UTC.
[null,null,["Last updated 2025-03-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eUMPConsentInformation\u003c/code\u003e provides access to user consent status and related information.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003erequestConsentInfoUpdateWithParameters:completionHandler:\u003c/code\u003e must be called in each session to update consent information.\u003c/p\u003e\n"],["\u003cp\u003eConsent status defaults to the previous session's value until the completion handler from \u003ccode\u003erequestConsentInfoUpdateWithParameters:completionHandler:\u003c/code\u003e is invoked.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecanRequestAds\u003c/code\u003e property indicates whether consent has been obtained in alignment with the app's configured messages.\u003c/p\u003e\n"],["\u003cp\u003eYou can reset all stored consent information by calling the \u003ccode\u003ereset\u003c/code\u003e method.\u003c/p\u003e\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;"]]