commit | author | age
|
96fe76
|
1 |
#import <UserMessagingPlatform/UMPConsentInformation.h> |
L |
2 |
|
|
3 |
@class UMPConsentForm; |
|
4 |
|
|
5 |
/// Provides a nonnull consentForm and a nil error if the load succeeded. Provides a nil |
|
6 |
/// consentForm and a nonnull error if the load failed. |
|
7 |
typedef void (^UMPConsentFormLoadCompletionHandler)(UMPConsentForm *_Nullable consentForm, |
|
8 |
NSError *_Nullable error); |
|
9 |
|
|
10 |
/// Called after presentation of a UMPConsentForm finishes. |
|
11 |
typedef void (^UMPConsentFormPresentCompletionHandler)(NSError *_Nullable error); |
|
12 |
|
|
13 |
/// A single use consent form object. |
|
14 |
@interface UMPConsentForm : NSObject |
|
15 |
/// Loads a consent form and calls completionHandler on completion. Must be called on the |
|
16 |
/// main queue. |
|
17 |
+ (void)loadWithCompletionHandler:(nonnull UMPConsentFormLoadCompletionHandler)completionHandler; |
|
18 |
|
|
19 |
/// Loads a consent form and immediately presents it from the provided viewController if |
|
20 |
/// UMPConsentInformation.sharedInstance.consentStatus is UMPConsentStatusRequired. Calls |
|
21 |
/// completionHandler after the user selects an option and the form is dismissed, or on the next run |
|
22 |
/// loop if no form is presented. Must be called on the main queue. |
|
23 |
+ (void)loadAndPresentIfRequiredFromViewController:(nonnull UIViewController *)viewController |
|
24 |
completionHandler:(nullable UMPConsentFormPresentCompletionHandler) |
|
25 |
completionHandler; |
|
26 |
|
|
27 |
/// Presents a privacy options form from the provided viewController if |
|
28 |
/// UMPConsentInformation.sharedInstance.privacyOptionsRequirementStatus is |
|
29 |
/// UMPPrivacyOptionsRequirementStatusRequired. Calls completionHandler with nil error after the |
|
30 |
/// user selects an option and the form is dismissed, or on the next run loop with a non-nil error |
|
31 |
/// if no form is presented. Must be called on the main queue. |
|
32 |
/// |
|
33 |
/// This method should only be called in response to a user input to request a privacy options form |
|
34 |
/// to be shown. The privacy options form is preloaded by the SDK automatically when a form becomes |
|
35 |
/// available. If no form is preloaded, the SDK will invoke the completionHandler on the next run |
|
36 |
/// loop, but will asynchronously retry to load one. |
|
37 |
+ (void)presentPrivacyOptionsFormFromViewController:(nonnull UIViewController *)viewController |
|
38 |
completionHandler: |
|
39 |
(nullable UMPConsentFormPresentCompletionHandler) |
|
40 |
completionHandler; |
|
41 |
|
|
42 |
/// Unavailable. Use +loadWithCompletionHandler: instead. |
|
43 |
- (nullable instancetype)init NS_UNAVAILABLE; |
|
44 |
|
|
45 |
/// Presents the full screen consent form over viewController. The form is dismissed and |
|
46 |
/// completionHandler is called after the user selects an option. |
|
47 |
/// UMPConsentInformation.sharedInstance.consentStatus is updated prior to completionHandler being |
|
48 |
/// called. completionHandler is called on the main queue. |
|
49 |
- (void)presentFromViewController:(nonnull UIViewController *)viewController |
|
50 |
completionHandler: |
|
51 |
(nullable UMPConsentFormPresentCompletionHandler)completionHandler; |
|
52 |
@end |