Skip to content

Commit

Permalink
Remove "universal" platform
Browse files Browse the repository at this point in the history
  • Loading branch information
scottrules44 committed Jan 15, 2022
1 parent 8d2b44d commit 8bd30c4
Show file tree
Hide file tree
Showing 182 changed files with 318 additions and 9,084 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#import <UserMessagingPlatform/UMPConsentInformation.h>

@class UMPConsentForm;

/// Provides a nonnull consentForm and a nil error if the load succeeded. Provides a nil
/// consentForm and a nonnull error if the load failed.
typedef void (^UMPConsentFormLoadCompletionHandler)(UMPConsentForm *_Nullable consentForm,
NSError *_Nullable error);

/// Called after presentation of a UMPConsentForm finishes.
typedef void (^UMPConsentFormPresentCompletionHandler)(NSError *_Nullable error);

/// A single use consent form object.
@interface UMPConsentForm : NSObject
/// Loads a consent form and calls completionHandler on completion. Must be called on the
/// main queue.
+ (void)loadWithCompletionHandler:(nonnull UMPConsentFormLoadCompletionHandler)completionHandler;

/// Unavailable. Use +loadWithCompletionHandler: instead.
- (nullable instancetype)init NS_UNAVAILABLE;

/// 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.
- (void)presentFromViewController:(nonnull UIViewController *)viewController
completionHandler:
(nullable UMPConsentFormPresentCompletionHandler)completionHandler;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#import <UIKit/UIKit.h>

#import <UserMessagingPlatform/UMPRequestParameters.h>

/// SDK version string, of a form "major.minor.patch".
extern NSString *_Nonnull const UMPVersionString;

/// Consent status values.
typedef NS_ENUM(NSInteger, UMPConsentStatus) {
UMPConsentStatusUnknown = 0, ///< Unknown consent status.
UMPConsentStatusRequired = 1, ///< User consent required but not yet obtained.
UMPConsentStatusNotRequired = 2, ///< Consent not required.
UMPConsentStatusObtained =
3, ///< User consent obtained, personalized vs non-personalized undefined.
};

/// State values for whether the user has a consent form available to them. To check whether form
/// status has changed, an update can be requested through
/// requestConsentInfoUpdateWithParameters:completionHandler.
typedef NS_ENUM(NSInteger, UMPFormStatus) {
/// Whether a consent form is available is unknown. An update should be requested using
/// requestConsentInfoUpdateWithParameters:completionHandler.
UMPFormStatusUnknown = 0,

/// Consent forms are available and can be loaded using [UMPConsentForm
/// loadWithCompletionHandler:]
UMPFormStatusAvailable = 1,

/// Consent forms are unavailable. Showing a consent form is not required.
UMPFormStatusUnavailable = 2,
};

/// Called when the consent info request completes. Error is nil on success, and non-nil if the
/// update failed.
typedef void (^UMPConsentInformationUpdateCompletionHandler)(NSError *_Nullable error);

/// Consent information. All methods must be called on the main thread.
@interface UMPConsentInformation : NSObject

/// The shared consent information instance.
@property(class, nonatomic, readonly, nonnull) UMPConsentInformation *sharedInstance;

/// The user's consent status. This value is cached between app sessions and can be read before
/// requesting updated parameters.
@property(nonatomic, readonly) UMPConsentStatus consentStatus;

/// Consent form status. This value defaults to UMPFormStatusUnknown and requires a call to
/// requestConsentInfoUpdateWithParameters:completionHandler to update.
@property(nonatomic, readonly) UMPFormStatus formStatus;

/// Requests consent information update. Must be called before loading a consent form.
- (void)requestConsentInfoUpdateWithParameters:(nullable UMPRequestParameters *)parameters
completionHandler:
(nonnull UMPConsentInformationUpdateCompletionHandler)handler;

/// Clears all consent state from persistent storage.
- (void)reset;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#import <Foundation/Foundation.h>

/// Debug values for testing geography.
typedef NS_ENUM(NSInteger, UMPDebugGeography) {
UMPDebugGeographyDisabled = 0, ///< Disable geography debugging.
UMPDebugGeographyEEA = 1, ///< Geography appears as in EEA for debug devices.
UMPDebugGeographyNotEEA = 2, ///< Geography appears as not in EEA for debug devices.
};

/// Overrides settings for debugging or testing.
@interface UMPDebugSettings : NSObject <NSCopying>

/// Array of device identifier strings. Debug features are enabled for devices with these
/// identifiers. Debug features are always enabled for simulators.
@property(nonatomic, nullable) NSArray<NSString *> *testDeviceIdentifiers;

/// Debug geography.
@property(nonatomic) UMPDebugGeography geography;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#import <Foundation/Foundation.h>

/// Error domain for all SDK errors.
extern NSErrorDomain _Nonnull const UMPErrorDomain;

/// Error codes used when making requests to update consent info.
typedef NS_ENUM(NSInteger, UMPRequestErrorCode) {
UMPRequestErrorCodeInternal = 1, ///< Internal error.
UMPRequestErrorCodeInvalidAppID = 2, ///< The application's app ID is invalid.
UMPRequestErrorCodeNetwork = 3, ///< Network error communicating with Funding Choices.
UMPRequestErrorCodeMisconfiguration =
4, ///< A misconfiguration exists in the Funding Choices UI.
};

/// Error codes used when loading and showing forms.
typedef NS_ENUM(NSInteger, UMPFormErrorCode) {
UMPFormErrorCodeInternal = 5, ///< Internal error.
UMPFormErrorCodeAlreadyUsed = 6, ///< Form was already used.
UMPFormErrorCodeUnavailable = 7, ///< Form is unavailable.
UMPFormErrorCodeTimeout = 8, ///< Loading a form timed out.
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import <UserMessagingPlatform/UMPDebugSettings.h>

/// Parameters sent on updates to user consent info.
@interface UMPRequestParameters : NSObject

/// Indicates whether the user is tagged for under age of consent.
@property(nonatomic) BOOL tagForUnderAgeOfConsent;

/// Debug settings for the request.
@property(nonatomic, copy, nullable) UMPDebugSettings *debugSettings;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <UserMessagingPlatform/UMPConsentForm.h>
#import <UserMessagingPlatform/UMPConsentInformation.h>
#import <UserMessagingPlatform/UMPDebugSettings.h>
#import <UserMessagingPlatform/UMPError.h>
#import <UserMessagingPlatform/UMPRequestParameters.h>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
framework module UserMessagingPlatform {
umbrella header "UserMessagingPlatform.h"

export *
module * { export * }

header "UMPConsentForm.h"
header "UMPDebugSettings.h"
header "UMPError.h"
header "UMPConsentInformation.h"
header "UMPRequestParameters.h"
}
Binary file not shown.
2 changes: 1 addition & 1 deletion plugins/2018.3326/iphone-sim/metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local metadata =
{
format = 'staticLibrary',
staticLibs = { 'APDGoogleAdMobAdapter', },
frameworks = { 'GoogleAppMeasurement', 'GoogleAppMeasurementIdentitySupport', 'GoogleMobileAds', 'FBLPromises', 'GoogleUtilities', 'nanopb', },
frameworks = { 'GoogleAppMeasurement', 'GoogleAppMeasurementIdentitySupport', 'GoogleMobileAds', 'FBLPromises', 'GoogleUtilities', 'nanopb', "UserMessagingPlatform" },
frameworksOptional = {},
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#import <UserMessagingPlatform/UMPConsentInformation.h>

@class UMPConsentForm;

/// Provides a nonnull consentForm and a nil error if the load succeeded. Provides a nil
/// consentForm and a nonnull error if the load failed.
typedef void (^UMPConsentFormLoadCompletionHandler)(UMPConsentForm *_Nullable consentForm,
NSError *_Nullable error);

/// Called after presentation of a UMPConsentForm finishes.
typedef void (^UMPConsentFormPresentCompletionHandler)(NSError *_Nullable error);

/// A single use consent form object.
@interface UMPConsentForm : NSObject
/// Loads a consent form and calls completionHandler on completion. Must be called on the
/// main queue.
+ (void)loadWithCompletionHandler:(nonnull UMPConsentFormLoadCompletionHandler)completionHandler;

/// Unavailable. Use +loadWithCompletionHandler: instead.
- (nullable instancetype)init NS_UNAVAILABLE;

/// 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.
- (void)presentFromViewController:(nonnull UIViewController *)viewController
completionHandler:
(nullable UMPConsentFormPresentCompletionHandler)completionHandler;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#import <UIKit/UIKit.h>

#import <UserMessagingPlatform/UMPRequestParameters.h>

/// SDK version string, of a form "major.minor.patch".
extern NSString *_Nonnull const UMPVersionString;

/// Consent status values.
typedef NS_ENUM(NSInteger, UMPConsentStatus) {
UMPConsentStatusUnknown = 0, ///< Unknown consent status.
UMPConsentStatusRequired = 1, ///< User consent required but not yet obtained.
UMPConsentStatusNotRequired = 2, ///< Consent not required.
UMPConsentStatusObtained =
3, ///< User consent obtained, personalized vs non-personalized undefined.
};

/// State values for whether the user has a consent form available to them. To check whether form
/// status has changed, an update can be requested through
/// requestConsentInfoUpdateWithParameters:completionHandler.
typedef NS_ENUM(NSInteger, UMPFormStatus) {
/// Whether a consent form is available is unknown. An update should be requested using
/// requestConsentInfoUpdateWithParameters:completionHandler.
UMPFormStatusUnknown = 0,

/// Consent forms are available and can be loaded using [UMPConsentForm
/// loadWithCompletionHandler:]
UMPFormStatusAvailable = 1,

/// Consent forms are unavailable. Showing a consent form is not required.
UMPFormStatusUnavailable = 2,
};

/// Called when the consent info request completes. Error is nil on success, and non-nil if the
/// update failed.
typedef void (^UMPConsentInformationUpdateCompletionHandler)(NSError *_Nullable error);

/// Consent information. All methods must be called on the main thread.
@interface UMPConsentInformation : NSObject

/// The shared consent information instance.
@property(class, nonatomic, readonly, nonnull) UMPConsentInformation *sharedInstance;

/// The user's consent status. This value is cached between app sessions and can be read before
/// requesting updated parameters.
@property(nonatomic, readonly) UMPConsentStatus consentStatus;

/// Consent form status. This value defaults to UMPFormStatusUnknown and requires a call to
/// requestConsentInfoUpdateWithParameters:completionHandler to update.
@property(nonatomic, readonly) UMPFormStatus formStatus;

/// Requests consent information update. Must be called before loading a consent form.
- (void)requestConsentInfoUpdateWithParameters:(nullable UMPRequestParameters *)parameters
completionHandler:
(nonnull UMPConsentInformationUpdateCompletionHandler)handler;

/// Clears all consent state from persistent storage.
- (void)reset;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#import <Foundation/Foundation.h>

/// Debug values for testing geography.
typedef NS_ENUM(NSInteger, UMPDebugGeography) {
UMPDebugGeographyDisabled = 0, ///< Disable geography debugging.
UMPDebugGeographyEEA = 1, ///< Geography appears as in EEA for debug devices.
UMPDebugGeographyNotEEA = 2, ///< Geography appears as not in EEA for debug devices.
};

/// Overrides settings for debugging or testing.
@interface UMPDebugSettings : NSObject <NSCopying>

/// Array of device identifier strings. Debug features are enabled for devices with these
/// identifiers. Debug features are always enabled for simulators.
@property(nonatomic, nullable) NSArray<NSString *> *testDeviceIdentifiers;

/// Debug geography.
@property(nonatomic) UMPDebugGeography geography;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#import <Foundation/Foundation.h>

/// Error domain for all SDK errors.
extern NSErrorDomain _Nonnull const UMPErrorDomain;

/// Error codes used when making requests to update consent info.
typedef NS_ENUM(NSInteger, UMPRequestErrorCode) {
UMPRequestErrorCodeInternal = 1, ///< Internal error.
UMPRequestErrorCodeInvalidAppID = 2, ///< The application's app ID is invalid.
UMPRequestErrorCodeNetwork = 3, ///< Network error communicating with Funding Choices.
UMPRequestErrorCodeMisconfiguration =
4, ///< A misconfiguration exists in the Funding Choices UI.
};

/// Error codes used when loading and showing forms.
typedef NS_ENUM(NSInteger, UMPFormErrorCode) {
UMPFormErrorCodeInternal = 5, ///< Internal error.
UMPFormErrorCodeAlreadyUsed = 6, ///< Form was already used.
UMPFormErrorCodeUnavailable = 7, ///< Form is unavailable.
UMPFormErrorCodeTimeout = 8, ///< Loading a form timed out.
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#import <UserMessagingPlatform/UMPDebugSettings.h>

/// Parameters sent on updates to user consent info.
@interface UMPRequestParameters : NSObject

/// Indicates whether the user is tagged for under age of consent.
@property(nonatomic) BOOL tagForUnderAgeOfConsent;

/// Debug settings for the request.
@property(nonatomic, copy, nullable) UMPDebugSettings *debugSettings;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#import <UserMessagingPlatform/UMPConsentForm.h>
#import <UserMessagingPlatform/UMPConsentInformation.h>
#import <UserMessagingPlatform/UMPDebugSettings.h>
#import <UserMessagingPlatform/UMPError.h>
#import <UserMessagingPlatform/UMPRequestParameters.h>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
framework module UserMessagingPlatform {
umbrella header "UserMessagingPlatform.h"

export *
module * { export * }

header "UMPConsentForm.h"
header "UMPDebugSettings.h"
header "UMPError.h"
header "UMPConsentInformation.h"
header "UMPRequestParameters.h"
}
Binary file not shown.
2 changes: 1 addition & 1 deletion plugins/2018.3326/iphone/metadata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local metadata =
{
format = 'staticLibrary',
staticLibs = { 'APDGoogleAdMobAdapter', },
frameworks = { 'GoogleAppMeasurement', 'GoogleAppMeasurementIdentitySupport', 'GoogleMobileAds', 'FBLPromises', 'GoogleUtilities', 'nanopb', },
frameworks = { 'GoogleAppMeasurement', 'GoogleAppMeasurementIdentitySupport', 'GoogleMobileAds', 'FBLPromises', 'GoogleUtilities', 'nanopb', "UserMessagingPlatform" },
frameworksOptional = {},
},
}
Expand Down
Binary file not shown.
Loading

0 comments on commit 8bd30c4

Please sign in to comment.