GoogleUserMessagingPlatform Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
@interface UMPConsentForm : NSObject
A single use consent form object.
-
Loads a consent form and calls completionHandler on completion. Must be called on the
main queue.
Declaration
Swift
class func load() async throws -> ConsentForm
-
Loads a consent form and immediately presents it from the provided viewController if
UMPConsentInformation.sharedInstance.consentStatus is UMPConsentStatusRequired. Calls
completionHandler after the user selects an option and the form is dismissed, or on the next run
loop if no form is presented. Must be called on the main queue. If viewController is nil, uses
the top view controller of the application’s main window.
Declaration
Swift
class func loadAndPresentIfRequired(from viewController: UIViewController?) async throws
Objective-C
+ (void)
loadAndPresentIfRequiredFromViewController:
(nullable UIViewController *)viewController
completionHandler:
(nullable
UMPConsentFormPresentCompletionHandler)
completionHandler;
-
Presents a privacy options form from the provided viewController if
UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus is
UMPPrivacyOptionsRequirementStatusRequired. Calls completionHandler with nil error after the
user selects an option and the form is dismissed, or on the next run loop with a non-nil error
if no form is presented. Must be called on the main queue.
This method should only be called in response to a user input to request a privacy options form
to be shown. The privacy options form is preloaded by the SDK automatically when a form becomes
available. If no form is preloaded, the SDK will invoke the completionHandler on the next run
loop, but will asynchronously retry to load one. If viewController is nil, uses the top view
controller of the application’s main window.
Declaration
Swift
class func presentPrivacyOptionsForm(from viewController: UIViewController?) async throws
Objective-C
+ (void)
presentPrivacyOptionsFormFromViewController:
(nullable UIViewController *)viewController
completionHandler:
(nullable
UMPConsentFormPresentCompletionHandler)
completionHandler;
-
Unavailable. Use +loadWithCompletionHandler: instead.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Presents the full screen consent form over viewController. The form is dismissed and
completionHandler is called after the user selects an option.
UMPConsentInformation.sharedInstance.consentStatus is updated prior to completionHandler being
called. completionHandler is called on the main queue. If viewController is nil, uses the top
view controller of the application’s main window.
Declaration
Swift
func present(from viewController: UIViewController?) async throws
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\u003eUMPConsentForm\u003c/code\u003e is a single-use object used to manage and display consent forms for user privacy.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to load and present consent forms, including options for automatic presentation based on consent status.\u003c/p\u003e\n"],["\u003cp\u003eThe form can be presented modally over a specified view controller or the application's top view controller.\u003c/p\u003e\n"],["\u003cp\u003eIt includes functionality to present a privacy options form, triggered by user request and subject to privacy options requirement status.\u003c/p\u003e\n"],["\u003cp\u003eInitialization of \u003ccode\u003eUMPConsentForm\u003c/code\u003e is unavailable directly; instead, use the provided class methods for loading and presentation.\u003c/p\u003e\n"]]],["The `UMPConsentForm` class manages user consent forms. Key actions include: loading a consent form via `loadWithCompletionHandler:`; loading and presenting it if required, using `loadAndPresentIfRequiredFromViewController:completionHandler:`; presenting a privacy options form with `presentPrivacyOptionsFormFromViewController:completionHandler:`. The method `presentFromViewController:completionHandler:` allows for displaying the consent form over a specified view controller. All actions occur on the main queue and utilize completion handlers for asynchronous results.\n"],null,["# GoogleUserMessagingPlatform Framework Reference\n\nUMPConsentForm\n==============\n\n\n @interface UMPConsentForm : NSObject\n\nA single use consent form object.\n- `\n ``\n ``\n `\n\n ### [+loadWithCompletionHandler:](#/c:objc(cs)UMPConsentForm(cm)loadWithCompletionHandler:)\n\n `\n ` \n Loads a consent form and calls completionHandler on completion. Must be called on the\n main queue. \n\n #### Declaration\n\n Swift \n\n class func load() async throws -\u003e ConsentForm\n\n Objective-C \n\n + (void)loadWithCompletionHandler:\n (nonnull ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormLoadCompletionHandler)completionHandler;\n\n- `\n ``\n ``\n `\n\n ### [+loadAndPresentIfRequiredFromViewController:completionHandler:](#/c:objc(cs)UMPConsentForm(cm)loadAndPresentIfRequiredFromViewController:completionHandler:)\n\n `\n ` \n Loads a consent form and immediately presents it from the provided viewController if\n UMPConsentInformation.sharedInstance.consentStatus is UMPConsentStatusRequired. Calls\n completionHandler after the user selects an option and the form is dismissed, or on the next run\n loop if no form is presented. Must be called on the main queue. If viewController is nil, uses\n the top view controller of the application's main window. \n\n #### Declaration\n\n Swift \n\n class func loadAndPresentIfRequired(from viewController: UIViewController?) async throws\n\n Objective-C \n\n + (void)\n loadAndPresentIfRequiredFromViewController:\n (nullable UIViewController *)viewController\n completionHandler:\n (nullable\n ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)\n completionHandler;\n\n- `\n ``\n ``\n `\n\n ### [+presentPrivacyOptionsFormFromViewController:completionHandler:](#/c:objc(cs)UMPConsentForm(cm)presentPrivacyOptionsFormFromViewController:completionHandler:)\n\n `\n ` \n Presents a privacy options form from the provided viewController if\n UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus is\n UMPPrivacyOptionsRequirementStatusRequired. Calls completionHandler with nil error after the\n user selects an option and the form is dismissed, or on the next run loop with a non-nil error\n if no form is presented. Must be called on the main queue.\n\n This method should only be called in response to a user input to request a privacy options form\n to be shown. The privacy options form is preloaded by the SDK automatically when a form becomes\n available. If no form is preloaded, the SDK will invoke the completionHandler on the next run\n loop, but will asynchronously retry to load one. If viewController is nil, uses the top view\n controller of the application's main window. \n\n #### Declaration\n\n Swift \n\n class func presentPrivacyOptionsForm(from viewController: UIViewController?) async throws\n\n Objective-C \n\n + (void)\n presentPrivacyOptionsFormFromViewController:\n (nullable UIViewController *)viewController\n completionHandler:\n (nullable\n ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)\n completionHandler;\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)UMPConsentForm(im)init)\n\n `\n ` \n Unavailable \n Unavailable. Use +loadWithCompletionHandler: instead. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;\n\n- `\n ``\n ``\n `\n\n ### [-presentFromViewController:completionHandler:](#/c:objc(cs)UMPConsentForm(im)presentFromViewController:completionHandler:)\n\n `\n ` \n Presents the full screen consent form over viewController. The form is dismissed and\n completionHandler is called after the user selects an option.\n UMPConsentInformation.sharedInstance.consentStatus is updated prior to completionHandler being\n called. completionHandler is called on the main queue. If viewController is nil, uses the top\n view controller of the application's main window. \n\n #### Declaration\n\n Swift \n\n func present(from viewController: UIViewController?) async throws\n\n Objective-C \n\n - (void)presentFromViewController:(nullable UIViewController *)viewController\n completionHandler:\n (nullable ../Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)\n completionHandler;"]]