# GoogleUserMessagingPlatform Framework Reference

# UMPConsentForm


    @interface UMPConsentForm : NSObject

A single use consent form object.
- `


  ### [+loadWithCompletionHandler:](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Classes/UMPConsentForm#/c:objc(cs)UMPConsentForm(cm)loadWithCompletionHandler:)


  ` Loads a consent form and calls completionHandler on completion. Must be called on the
  main queue.

  #### Declaration

  Swift

      class func load() async throws -> ConsentForm

  Objective-C

      + (void)loadWithCompletionHandler:
          (nonnull https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormLoadCompletionHandler)completionHandler;

- `


  ### [+loadAndPresentIfRequiredFromViewController:completionHandler:](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Classes/UMPConsentForm#/c:objc(cs)UMPConsentForm(cm)loadAndPresentIfRequiredFromViewController:completionHandler:)


  ` 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
                                            https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)
                                           completionHandler;

- `


  ### [+presentPrivacyOptionsFormFromViewController:completionHandler:](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Classes/UMPConsentForm#/c:objc(cs)UMPConsentForm(cm)presentPrivacyOptionsFormFromViewController: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
                                             https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)
                                            completionHandler;

- `


  ### [-init](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Classes/UMPConsentForm#/c:objc(cs)UMPConsentForm(im)init)


  ` Unavailable
  Unavailable. Use +loadWithCompletionHandler: instead.

  #### Declaration

  Objective-C

      - (nonnull instancetype)init;

- `


  ### [-presentFromViewController:completionHandler:](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Classes/UMPConsentForm#/c:objc(cs)UMPConsentForm(im)presentFromViewController:completionHandler:)


  ` 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

  Objective-C

      - (void)presentFromViewController:(nullable UIViewController *)viewController
                      completionHandler:
                          (nullable https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/ios/privacy/api/reference/Type-Definitions.html#/c:UMPConsentForm.h@T@UMPConsentFormPresentCompletionHandler)
                              completionHandler;