commit | author | age
|
96fe76
|
1 |
#import <UIKit/UIKit.h> |
L |
2 |
|
|
3 |
#import <UserMessagingPlatform/UMPRequestParameters.h> |
|
4 |
|
|
5 |
/// SDK version string, of a form "major.minor.patch". |
|
6 |
extern NSString *_Nonnull const UMPVersionString; |
|
7 |
|
|
8 |
/// Consent status values. |
|
9 |
typedef NS_ENUM(NSInteger, UMPConsentStatus) { |
|
10 |
UMPConsentStatusUnknown = 0, ///< Unknown consent status. |
|
11 |
UMPConsentStatusRequired = 1, ///< User consent required but not yet obtained. |
|
12 |
UMPConsentStatusNotRequired = 2, ///< Consent not required. |
|
13 |
UMPConsentStatusObtained = |
|
14 |
3, ///< User consent obtained, personalized vs non-personalized undefined. |
|
15 |
}; |
|
16 |
|
|
17 |
/// State values for whether the user has a consent form available to them. To check whether form |
|
18 |
/// status has changed, an update can be requested through |
|
19 |
/// requestConsentInfoUpdateWithParameters:completionHandler. |
|
20 |
typedef NS_ENUM(NSInteger, UMPFormStatus) { |
|
21 |
/// Whether a consent form is available is unknown. An update should be requested using |
|
22 |
/// requestConsentInfoUpdateWithParameters:completionHandler. |
|
23 |
UMPFormStatusUnknown = 0, |
|
24 |
|
|
25 |
/// Consent forms are available and can be loaded using [UMPConsentForm |
|
26 |
/// loadWithCompletionHandler:] |
|
27 |
UMPFormStatusAvailable = 1, |
|
28 |
|
|
29 |
/// Consent forms are unavailable. Showing a consent form is not required. |
|
30 |
UMPFormStatusUnavailable = 2, |
|
31 |
}; |
|
32 |
|
|
33 |
/// State values for whether the user needs to be provided a way to modify their privacy options. |
|
34 |
typedef NS_ENUM(NSInteger, UMPPrivacyOptionsRequirementStatus) { |
|
35 |
/// Requirement unknown. |
|
36 |
UMPPrivacyOptionsRequirementStatusUnknown = 0, |
|
37 |
/// A way must be provided for the user to modify their privacy options. |
|
38 |
UMPPrivacyOptionsRequirementStatusRequired = 1, |
|
39 |
/// User does not need to modify their privacy options. Either consent is not required, or the |
|
40 |
/// consent type does not require modification. |
|
41 |
UMPPrivacyOptionsRequirementStatusNotRequired = 2, |
|
42 |
}; |
|
43 |
|
|
44 |
/// Called when the consent info request completes. Error is nil on success, and non-nil if the |
|
45 |
/// update failed. |
|
46 |
typedef void (^UMPConsentInformationUpdateCompletionHandler)(NSError *_Nullable error); |
|
47 |
|
|
48 |
/// Consent information. All methods must be called on the main thread. |
|
49 |
@interface UMPConsentInformation : NSObject |
|
50 |
|
|
51 |
/// The shared consent information instance. |
|
52 |
@property(class, nonatomic, readonly, nonnull) UMPConsentInformation *sharedInstance; |
|
53 |
|
|
54 |
/// The user's consent status. This value defaults to UMPConsentStatusUnknown until |
|
55 |
/// requestConsentInfoUpdateWithParameters:completionHandler: is called, and defaults to the |
|
56 |
/// previous session's value until |completionHandler| from |
|
57 |
/// requestConsentInfoUpdateWithParameters:completionHandler: is called. |
|
58 |
@property(nonatomic, readonly) UMPConsentStatus consentStatus; |
|
59 |
|
|
60 |
/// Indicates whether the app has completed the necessary steps for gathering updated user consent. |
|
61 |
/// Returns NO until requestConsentInfoUpdateWithParameters:completionHandler: is called. Returns |
|
62 |
/// YES once requestConsentInfoUpdateWithParameters:completionHandler: is called and when |
|
63 |
/// consentStatus is UMPConsentStatusNotRequired or UMPConsentStatusObtained. |
|
64 |
@property(nonatomic, readonly) BOOL canRequestAds; |
|
65 |
|
|
66 |
/// Consent form status. This value defaults to UMPFormStatusUnknown and requires a call to |
|
67 |
/// requestConsentInfoUpdateWithParameters:completionHandler: to update. |
|
68 |
@property(nonatomic, readonly) UMPFormStatus formStatus; |
|
69 |
|
|
70 |
/// Privacy options requirement status. This value defaults to |
|
71 |
/// UMPPrivacyOptionsRequirementStatusUnknown until |
|
72 |
/// requestConsentInfoUpdateWithParameters:completionHandler: is called, and defaults to the |
|
73 |
/// previous session's value until |completionHandler| from |
|
74 |
/// requestConsentInfoUpdateWithParameters:completionHandler: is called. |
|
75 |
@property(nonatomic, readonly) UMPPrivacyOptionsRequirementStatus privacyOptionsRequirementStatus; |
|
76 |
|
|
77 |
/// Requests consent information update. Must be called in every app session before checking the |
|
78 |
/// user's consentStatus or loading a consent form. After calling this method, consentStatus will be |
|
79 |
/// updated synchronously to hold the consent state from the previous app session, if one exists. |
|
80 |
/// consentStatus may be updated again immediately before the completion handler is called. |
|
81 |
- (void)requestConsentInfoUpdateWithParameters:(nullable UMPRequestParameters *)parameters |
|
82 |
completionHandler: |
|
83 |
(nonnull UMPConsentInformationUpdateCompletionHandler)handler; |
|
84 |
|
|
85 |
/// Clears all consent state from persistent storage. |
|
86 |
- (void)reset; |
|
87 |
|
|
88 |
@end |