diff --git a/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/Makefile b/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/Makefile deleted file mode 100755 index 6b65705..0000000 --- a/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -XBUILD=/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -PROJECT_ROOT=./apple-static-library -PROJECT=$(PROJECT_ROOT)/mParticle-Apple-SDK.xcodeproj -TARGET=mParticle-Apple-SDK - -all: clone lib$(TARGET).a cleanIntermediaries - -clone: - git clone git@git.corp.mparticle.com:mParticle/apple-static-library.git - -lib$(TARGET)-i386.a: - $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphonesimulator -configuration Release clean build - -mv $(PROJECT_ROOT)/build/Release-iphonesimulator/lib$(TARGET).a $@ - -lib$(TARGET)-armv7.a: - $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch armv7 -configuration Release clean build - -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@ - -lib$(TARGET)-arm64.a: - $(XBUILD) -project $(PROJECT) -target $(TARGET) -sdk iphoneos -arch arm64 -configuration Release clean build - -mv $(PROJECT_ROOT)/build/Release-iphoneos/lib$(TARGET).a $@ - -lib$(TARGET).a: lib$(TARGET)-i386.a lib$(TARGET)-armv7.a lib$(TARGET)-arm64.a - xcrun -sdk iphoneos lipo -create -output $@ $^ - -cleanIntermediaries: - -rm -rf apple-static-library - -rm lib$(TARGET)-armv7.a - -rm lib$(TARGET)-arm64.a - -rm lib$(TARGET)-i386.a - -cleanAllBinary: - -rm -f *.a *.dll - -clean: cleanIntermediaries cleanAllBinary \ No newline at end of file diff --git a/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/README.md b/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/README.md deleted file mode 100644 index 3b9ff54..0000000 --- a/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/README.md +++ /dev/null @@ -1,10 +0,0 @@ -This Makefile does the following: - -- Clones the apple sdk setup as a static library - -- Creates binary for all architectures - -- Combines them into one fat binary (you should ulimately use the libmParticle-Apple-SDK.a) - -- Make sure you add the lib as a Native Reference to the Xamarin project, enable Smart Link, enable Force Load and add -the following linker flags -lsqlite3 -lstdc++.6 -lc++ diff --git a/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/libmParticle-Apple-SDK.a b/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/libmParticle-Apple-SDK.a deleted file mode 100644 index 20d67f5..0000000 Binary files a/Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/libmParticle-Apple-SDK.a and /dev/null differ diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle.Xamarin.iOSBinding.csproj b/Bindings/mParticle.Xamarin.iOSBinding/mParticle.Xamarin.iOSBinding.csproj index ce9e34e..cf2fb6c 100644 --- a/Bindings/mParticle.Xamarin.iOSBinding/mParticle.Xamarin.iOSBinding.csproj +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle.Xamarin.iOSBinding.csproj @@ -42,10 +42,9 @@ - - Static - True - -lsqlite3 -lc++ + + Framework + False diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/FilteredMPIdentityApiRequest.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/FilteredMPIdentityApiRequest.h new file mode 100644 index 0000000..bf1cd26 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/FilteredMPIdentityApiRequest.h @@ -0,0 +1,21 @@ +// +// FilteredMPIdentityApiRequest.h +// + +#import +#import "FilteredMParticleUser.h" + +NS_ASSUME_NONNULL_BEGIN +@class MPIdentityApiRequest; + +@interface FilteredMPIdentityApiRequest : NSObject + +@property (nonatomic, strong, nullable, readonly) NSString *email; +@property (nonatomic, strong, nullable, readonly) NSString *customerId; +@property (nonatomic, strong, nullable, readonly) NSDictionary *userIdentities; + +- (instancetype)initWithIdentityRequest:(MPIdentityApiRequest *)request kitConfiguration:(MPKitConfiguration *)kitConfiguration; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/FilteredMParticleUser.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/FilteredMParticleUser.h new file mode 100644 index 0000000..560b9e3 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/FilteredMParticleUser.h @@ -0,0 +1,35 @@ +// +// FilteredMParticleUser.h +// + +#import +#import "MPCart.h" + +@class MParticleUser; +@class MPKitConfiguration; + +@interface FilteredMParticleUser : NSObject + +@property(readonly, strong, nonnull) NSNumber *userId; + +/** + Returns whether this user is currently logged in + */ +@property(readonly) BOOL isLoggedIn; + +/** + Gets current user identities (readonly) + @returns A dictionary containing the collection of user identities + @see MPUserIdentity + */ +@property (readonly, strong, nonnull) NSDictionary *userIdentities; + +/** + Gets all user attributes. + @returns A dictionary containing the collection of user attributes. + */ +@property (readonly, strong, nonnull) NSDictionary *userAttributes; + +- (instancetype _Nonnull )initWithMParticleUser:(MParticleUser *_Nonnull)user kitConfiguration:(MPKitConfiguration *_Nonnull)kitConfiguration; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCart.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCart.h new file mode 100644 index 0000000..5a723bc --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCart.h @@ -0,0 +1,104 @@ +#import + +@class MPProduct; + +/** + This class is used to keep the state of the shopping cart for a given user. + E-commerce transactions logged using the MPCommerce class or the logCommerceEvent: method will keep the state of the respective products in here. + + Once products are added to the cart, its contents are persisted through the lifetime of the app. Therefore it is important that after completing an ecommerce transaction + (purchase, refund, etc) that you call the cart's clear method to empty its content and remove whatever data was persisted. + + @see MPCommerce + @see mParticle + */ +@interface MPCart : NSObject + +/** + Adds a product to the shopping cart. + Calling this method directly will create a AddToCart MPCommerceEvent with product and invoke the logCommerceEvent: method on your behalf. + + Swift +

+ cart.addProduct(product)
+ 
+ + Objective-C +

+ [cart addProduct:product];
+ 
+ + @param product An instance of MPProduct + + @see MPCommerceEvent + @see mParticle + */ +- (void)addProduct:(nonnull MPProduct *)product; + +/** + Adds an array of products to the shopping cart. + Optionally, this method will also log an event for each one. + + Swift +

+ cart.addAllProducts(products, shouldLogEvents:false)
+ 
+ + Objective-C +

+ [cart addAllProducts:products shouldLogEvents:NO];
+ 
+ + @param products An array of MPProduct instances + @param shouldLogEvents Whether or not events should be logged for each product + + @see MPCommerceEvent + @see mParticle + */ +- (void)addAllProducts:(nonnull NSArray *)products shouldLogEvents:(BOOL)shouldLogEvents; + +/** + Empties the shopping cart. Removes all its contents and respective persisted data. + + Swift +

+ cart.clear()
+ 
+ + Objective-C +

+ [cart clear];
+ 
+ */ +- (void)clear; + +/** + Returns the collection of products in the shopping cart. + @returns An array with products in the shopping cart or nil if the cart is empty. + */ +- (nullable NSArray *)products; + +/** + Removes a product from the shopping cart. + Calling this method directly will create a RemoveFromCart MPCommerceEvent with product and invoke the logCommerceEvent: method on your behalf. + + Swift + +

+ cart.removeProduct(product)
+ 
+ + Objective-C + +

+ [cart removeProduct:product];
+ 
+ + @param product An instance of MPProduct + + @see MPCommerceEvent + @see mParticle + */ +- (void)removeProduct:(nonnull MPProduct *)product; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerce.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerce.h new file mode 100644 index 0000000..50d9f31 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerce.h @@ -0,0 +1,92 @@ +#import + +@class MPCart; +@class MPTransactionAttributes; + +/** + This class is a convenience wrapper to using the e-commerce methods. + It contains a reference to the cart singleton (MPCart), which should be used to log adding and removing products to the shopping cart. + + Using the methods and properties of this class should be done through the instance provided in the mParticle singleton. + + Note that all operations provided here can be accomplished through the logCommerceEvent: method. + + Usage: + + Swift +

+ let commerce = MParticle.sharedInstance().commerce
+ 
+ commerce.cart.addProduct(product)
+ 
+ commerce.purchaseWithTransactionAttributes(transactionAttributes, clearCart:true)
+ 
+ + Objective-C +

+ MPCommerce *commerce = [MParticle sharedInstance].commerce;
+ 
+ [commerce.cart addProduct:product];
+ 
+ [commerce purchaseWithTransactionAttributes:transactionAttributes clearCart:YES];
+ 
+ + @see MPCart + @see MPTransactionAttributes + @see mParticle + */ +@interface MPCommerce : NSObject + +/** + A reference to the MPCart singleton. + + @see MPCart + */ +@property (nonatomic, strong, readonly, nonnull) MPCart *cart; + +/** + The currency used in the commerce event. + */ +@property (nonatomic, strong, nullable) NSString *currency; + +/** + Logs a checkout commerce event with the products contained in the shopping cart. + */ +- (void)checkout; + +/** + Logs a checkout with options commerce event with the products contained in the shopping cart. + + @param options A string describing what the options are + @param step The step number, within the chain of commerce event transactions, corresponding to the checkout + */ +- (void)checkoutWithOptions:(nullable NSString *)options step:(NSInteger)step; + +/** + Clears the contents of the shopping cart. + + This method is equivalent to calling the MPCart's clear method. + */ +- (void)clearCart; + +/** + Logs a purchase commerce event with the products contained in the shopping cart. + + @param transactionAttributes The attributes of the transaction, such as: transactionId, tax, affiliation, shipping, etc. + @param clearCart A flag indicating whether the shopping cart should be cleared after logging this commerce event. + + @see MPTransactionAttributes + */ +- (void)purchaseWithTransactionAttributes:(nonnull MPTransactionAttributes *)transactionAttributes clearCart:(BOOL)clearCart; + +/** + Logs a refund commerce event with the products contained in the shopping cart. + + @param transactionAttributes The attributes of the transaction, such as: transactionId, tax, affiliation, shipping, etc. + @param clearCart A flag indicating whether the shopping cart should be cleared after logging this commerce event. + + @see MPTransactionAttributes + */ +- (void)refundTransactionAttributes:(nonnull MPTransactionAttributes *)transactionAttributes clearCart:(BOOL)clearCart; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEvent+Dictionary.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEvent+Dictionary.h new file mode 100644 index 0000000..7183fd1 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEvent+Dictionary.h @@ -0,0 +1,37 @@ +#import "MPEnums.h" +#import "MPCommerceEvent.h" +#import "MPCommerceEventInstruction.h" + +typedef NS_ENUM(NSInteger, MPCommerceEventKind) { + MPCommerceEventKindUnknown = 0, + MPCommerceEventKindProduct = 1, + MPCommerceEventKindPromotion, + MPCommerceEventKindImpression +}; + + +@interface MPCommerceEvent(Dictionary) + +- (instancetype)initWithAction:(MPCommerceEventAction)action; +- (NSString *)actionNameForAction:(MPCommerceEventAction)action; +- (MPCommerceEventAction)actionWithName:(NSString *)actionName; +- (void)addProducts:(NSArray *)products; +- (NSDictionary *)dictionaryRepresentation; +- (NSArray *)expandedInstructions; +- (NSArray *const)addedProducts; +- (MPCommerceEventKind)kind; +- (void)removeProducts:(NSArray *)products; +- (NSArray *const)removedProducts; +- (void)resetLatestProducts; +- (MPEventType)type; +- (NSMutableDictionary *)beautifiedAttributes; +- (void)setBeautifiedAttributes:(NSMutableDictionary *)beautifiedAttributes; +- (NSMutableDictionary *)userDefinedAttributes; +- (void)setUserDefinedAttributes:(NSMutableDictionary *)userDefinedAttributes; +- (void)setImpressions:(NSDictionary *> *)impressions; +- (void)setProducts:(NSArray *)products; +- (NSMutableDictionary *> *)copyImpressionsMatchingHashedProperties:(NSDictionary *)hashedMap; +- (NSDate *)timestamp; +- (void)setTimestamp:(NSDate *)timestamp; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEvent.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEvent.h new file mode 100644 index 0000000..b20412e --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEvent.h @@ -0,0 +1,234 @@ +#import + +@class MPProduct; +@class MPPromotionContainer; +@class MPTransactionAttributes; + +typedef NS_ENUM(NSUInteger, MPCommerceEventAction) { + MPCommerceEventActionAddToCart = 0, + MPCommerceEventActionRemoveFromCart, + MPCommerceEventActionAddToWishList, + MPCommerceEventActionRemoveFromWishlist, + MPCommerceEventActionCheckout, + MPCommerceEventActionCheckoutOptions, + MPCommerceEventActionClick, + MPCommerceEventActionViewDetail, + MPCommerceEventActionPurchase, + MPCommerceEventActionRefund +}; + + +/** + This class contains the information and represents a commerce event to be logged using the mParticle SDK. + + Usage: + + Swift +

+ let commerceEvent = MPCommerceEvent(action: MPCommerceEventAction.AddToCart, product: product1)
+ 
+ let mParticle = MParticle.sharedInstance()
+ 
+ mParticle.logCommerceEvent(commerceEvent)
+ 
+ + Objective-C +

+ MPCommerceEvent *commerceEvent = [[MPCommerceEvent alloc] initWithAction:MPCommerceEventActionAddToCart product:product1];
+ 
+ MParticle *mParticle = [MParticle sharedInstance];
+ 
+ [mParticle logCommerceEvent:commerceEvent];
+ 
+ + @see mParticle + */ +@interface MPCommerceEvent : NSObject { +@protected + NSDate *_timestamp; +} + +/** + Checkout option string describing what the options are. + */ +@property (nonatomic, strong, nullable) NSString *checkoutOptions; + +/** + The currency used in the commerce event. + */ +@property (nonatomic, strong, nullable) NSString *currency; + +/** + A dictionary containing list names as keys and arrays of products impressed under that list name + +

+ {"listName1":[product1, product2]}
+ 
+ */ +@property (nonatomic, strong, readonly, nullable) NSDictionary *> *impressions; + +/** + List of products being applied action + */ +@property (nonatomic, strong, readonly, nullable) NSArray *products; + +/** + A promotion container describing a promotion action and its respective products. + + @see MPPromotionContainer + */ +@property (nonatomic, strong, nullable) MPPromotionContainer *promotionContainer; + +/** + Describes a product action list for this commerce event transaction. + */ +@property (nonatomic, strong, nullable) NSString *productListName; + +/** + Describes a product list source for this commerce event transaction. + */ +@property (nonatomic, strong, nullable) NSString *productListSource; + +/** + The label describing the screen on which the commerce event transaction occurred + */ +@property (nonatomic, strong, nullable) NSString *screenName; + +/** + The attributes of the transaction, such as: transactionId, tax, affiliation, shipping, etc. + + @see MPTransactionAttributes + */ +@property (nonatomic, strong, nullable) MPTransactionAttributes *transactionAttributes; + +/** +Custom flags are a collection of attributes used to trigger functionality in specific integrations. By default, most integrations will ignore custom flags. Reference the documentation for your integrations to see if they make use of custom flags. + */ +@property (nonatomic, strong, readonly, nonnull) NSDictionary *> *customFlags; + +/** + A value from the MPCommerceEventAction enum describing the commerce event action. + */ +@property (nonatomic, unsafe_unretained) MPCommerceEventAction action; + +/** + The step number, within the chain of commerce event transactions, corresponding to the checkout. + */ +@property (nonatomic, unsafe_unretained) NSInteger checkoutStep; + +/** + Flag indicating whether a refund is non-interactive. The default value is false/NO. + */ +@property (nonatomic, unsafe_unretained) BOOL nonInteractive; + +/** + Initializes an instance of MPCommerceEvent with an action and a product. + + @param action A value from the MPCommerceEventAction enum describing the commerce event action + @param product An instance of MPProduct + + @see MPCommerceEventAction + */ +- (nonnull instancetype)initWithAction:(MPCommerceEventAction)action product:(nullable MPProduct *)product; + +/** + Initializes an instance of MPCommerceEvent with a list name for a product impression. + + @param listName A string under which the product was listed for this impression + @param product An instance of MPProduct + */ +- (nonnull instancetype)initWithImpressionName:(nullable NSString *)listName product:(nullable MPProduct *)product; + +/** + Initializes an instance of MPCommerceEvent with a promotion container (promotion for products). + + @param promotionContainer An instance of MPPromotionContainer describing a promotion action and its respective products + + @see MPPromotionContainer + */ +- (nonnull instancetype)initWithPromotionContainer:(nullable MPPromotionContainer *)promotionContainer; + +/** + Adds the representation of a product impression under a given list name. + + @param product An instance of MPProduct + @param listName A string under which the product was listed for this impression + */ +- (void)addImpression:(nonnull MPProduct *)product listName:(nonnull NSString *)listName; + +/** + Adds a product to the list of products to have action applied to. + + @param product An instance of MPProduct + */ +- (void)addProduct:(nonnull MPProduct *)product; + +/** + Removes a product from the list of products to have action applied to. + + @param product An instance of MPProduct + */ +- (void)removeProduct:(nonnull MPProduct *)product; + +/** + Associates a custom dictionary of key/value pairs to the commerce event. + + Alternatively you can set custom attributes using the regular notation for setting key/value pairs in an NSMutableDictionary. + + For example: + + Swift +

+ let commerceEvent = MPCommerceEvent(action: MPCommerceEventAction.AddToCart, product: product1)
+ 
+ commerceEvent.setCustomAttributes(dictionaryOfKeyValuePairs)
+ 
+ commerceEvent["Custom Key"] = "Custom Value"
+ 
+ + Objective-C +

+ MPCommerceEvent *commerceEvent = [[MPCommerceEvent alloc] initWithAction:MPCommerceEventActionAddToCart product:product1];
+ 
+ [commerceEvent setCustomAttributes:dictionaryOfKeyValuePairs];
+ 
+ commerceEvent[@"Custom Key"] = @"Custom Value";
+ 
+ + @param customAttributes A dictionary containing the custom key/value pairs. + */ +- (void)setCustomAttributes:(nullable NSDictionary *)customAttributes; + +/** + Returns an array with all keys in the custom attributes dictionary + @returns An array with all keys in the custom attributes dictionary + */ +- (nullable NSArray *)allKeys; + +- (nullable id)objectForKeyedSubscript:(nonnull NSString *const)key; +- (void)setObject:(nonnull id)obj forKeyedSubscript:(nonnull NSString *)key; + +/** + Adds a custom flag associated with a key to the event. + @param customFlag A string attribute + @param key The key associated with the custom flag. + */ +- (void)addCustomFlag:(nonnull NSString *)customFlag withKey:(nonnull NSString *)key; + +/** + Adds an array of custom flags associated with a key to the event. + @param customFlags An array of string attributes + @param key The key associated with the custom flags. + */ +- (void)addCustomFlags:(nonnull NSArray *)customFlags withKey:(nonnull NSString *)key; + +@end + +extern NSString * _Nonnull const kMPCEInstructionsKey; +extern NSString * _Nonnull const kMPExpCECheckoutOptions; +extern NSString * _Nonnull const kMPExpCECurrency; +extern NSString * _Nonnull const kMPExpCEProductListName; +extern NSString * _Nonnull const kMPExpCEProductListSource; +extern NSString * _Nonnull const kMPExpCECheckoutStep; +extern NSString * _Nonnull const kMPExpCEProductImpressionList; +extern NSString * _Nonnull const kMPExpCEProductCount; diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEventInstruction.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEventInstruction.h new file mode 100644 index 0000000..89e5aee --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPCommerceEventInstruction.h @@ -0,0 +1,20 @@ +#import + +@class MPEvent; +@class MPProduct; + +typedef NS_ENUM(NSUInteger, MPCommerceInstruction) { + MPCommerceInstructionEvent = 0, + MPCommerceInstructionTransaction +}; + +@interface MPCommerceEventInstruction : NSObject + +@property (nonatomic, strong, readonly) MPEvent *event; +@property (nonatomic, strong, readonly) MPProduct *product; +@property (nonatomic, unsafe_unretained, readonly) MPCommerceInstruction instruction; + +- (instancetype)initWithInstruction:(MPCommerceInstruction)instruction event:(MPEvent *)event; +- (instancetype)initWithInstruction:(MPCommerceInstruction)instruction event:(MPEvent *)event product:(MPProduct *)product __attribute__((objc_designated_initializer)); + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPConsentState.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPConsentState.h new file mode 100644 index 0000000..1d4aa03 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPConsentState.h @@ -0,0 +1,43 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@class MPGDPRConsent; + +/** + * ConsentState represents the set of purposes and regulations for which a user + * has consented for data collection. + */ +@interface MPConsentState : NSObject + +/** + * Retrieve the current GDPR consent state for this user. + * + * Note that all purpose keys will be lower-cased and trimmed. + */ +- (nullable NSDictionary *)gdprConsentState; + +/** + * Add or override a single GDPR consent state. + * + * Note that all purpose keys will be lower-cased and trimmed. + */ +- (void)addGDPRConsentState:(MPGDPRConsent *)consent purpose:(NSString *)purpose; + +/** + * Remove a single GDPR consent state for this builder. + * + * Note that all purpose keys will be lower-cased and trimmed. + */ +- (void)removeGDPRConsentStateWithPurpose:(NSString *)purpose; + +/** + * Set/replace the entire GDPR consent state of this builder. + * + * Note that all purpose keys will be lower-cased and trimmed. + */ +- (void)setGDPRConsentState:(nullable NSDictionary *)consentState; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPDateFormatter.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPDateFormatter.h new file mode 100644 index 0000000..643fa10 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPDateFormatter.h @@ -0,0 +1,11 @@ +#import + +@interface MPDateFormatter : NSObject + ++ (nullable NSDate *)dateFromString:(nonnull NSString *)dateString; ++ (nullable NSDate *)dateFromStringRFC1123:(nonnull NSString *)dateString; ++ (nullable NSDate *)dateFromStringRFC3339:(nonnull NSString *)dateString; ++ (nullable NSString *)stringFromDateRFC1123:(nonnull NSDate *)date; ++ (nullable NSString *)stringFromDateRFC3339:(nonnull NSDate *)date; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPEnums.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPEnums.h new file mode 100644 index 0000000..01c9f8f --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPEnums.h @@ -0,0 +1,404 @@ +#ifndef mParticle_MPEnums_h +#define mParticle_MPEnums_h + +#import + +/// Running Environment +typedef NS_ENUM(NSUInteger, MPEnvironment) { + /** Tells the SDK to auto detect the current run environment (initial value) */ + MPEnvironmentAutoDetect = 0, + /** The SDK is running in development mode (Debug/Development or AdHoc) */ + MPEnvironmentDevelopment, + /** The SDK is running in production mode (App Store) */ + MPEnvironmentProduction +}; + +/// Event Types +typedef NS_ENUM(NSUInteger, MPEventType) { + /** Use for navigation related events */ + MPEventTypeNavigation = 1, + /** Use for location related events */ + MPEventTypeLocation = 2, + /** Use for search related events */ + MPEventTypeSearch = 3, + /** Use for transaction related events */ + MPEventTypeTransaction = 4, + /** Use for user content related events */ + MPEventTypeUserContent = 5, + /** Use for user preference related events */ + MPEventTypeUserPreference = 6, + /** Use for social related events */ + MPEventTypeSocial = 7, + /** Use for other types of events not contained in this enum */ + MPEventTypeOther = 8, + /** 9 used to be MPEventTypeMedia. It has been discontinued */ + /** Internal. Used when a product is added to the cart */ + MPEventTypeAddToCart = 10, + /** Internal. Used when a product is removed from the cart */ + MPEventTypeRemoveFromCart = 11, + /** Internal. Used when the cart goes to checkout */ + MPEventTypeCheckout = 12, + /** Internal. Used when the cart goes to checkout with options */ + MPEventTypeCheckoutOption = 13, + /** Internal. Used when a product is clicked */ + MPEventTypeClick = 14, + /** Internal. Used when user views the details of a product */ + MPEventTypeViewDetail = 15, + /** Internal. Used when a product is purchased */ + MPEventTypePurchase = 16, + /** Internal. Used when a product refunded */ + MPEventTypeRefund = 17, + /** Internal. Used when a promotion is displayed */ + MPEventTypePromotionView = 18, + /** Internal. Used when a promotion is clicked */ + MPEventTypePromotionClick = 19, + /** Internal. Used when a product is added to the wishlist */ + MPEventTypeAddToWishlist = 20, + /** Internal. Used when a product is removed from the wishlist */ + MPEventTypeRemoveFromWishlist = 21, + /** Internal. Used when a product is displayed in a promotion */ + MPEventTypeImpression = 22 +}; + +/// Installation Types +typedef NS_ENUM(NSInteger, MPInstallationType) { + /** mParticle auto-detects the installation type. This is the default value */ + MPInstallationTypeAutodetect = 0, + /** Informs mParticle this binary is a new installation */ + MPInstallationTypeKnownInstall, + /** Informs mParticle this binary is an upgrade */ + MPInstallationTypeKnownUpgrade, + /** Informs mParticle this binary is the same version. This value is for internal use only. It should not be used by developers */ + MPInstallationTypeKnownSameVersion +}; + +/// Location Tracking Authorization Request +typedef NS_ENUM(NSUInteger, MPLocationAuthorizationRequest) { + /** Requests authorization to always use location services */ + MPLocationAuthorizationRequestAlways = 0, + /** Requests authorization to use location services when the app is in use */ + MPLocationAuthorizationRequestWhenInUse +}; + +/// eCommerce Product Events +typedef NS_ENUM(NSInteger, MPProductEvent) { + /** To be used when a product is viewed by a user */ + MPProductEventView = 0, + /** To be used when a user adds a product to a wishlist */ + MPProductEventAddedToWishList, + /** To be used when a user removes a product from a wishlist */ + MPProductEventRemovedFromWishList, + /** To be used when a user adds a product to a cart */ + MPProductEventAddedToCart, + /** To be used when a user removes a product from a cart */ + MPProductEventRemovedFromCart +}; + +/// Survey Providers +typedef NS_ENUM(NSUInteger, MPSurveyProvider) { + MPSurveyProviderForesee = 64 +}; + +/// User Identities +typedef NS_ENUM(NSUInteger, MPUserIdentity) { + /** User identity other */ + MPUserIdentityOther = 0, + /** User identity customer id. This is an id issued by your own system */ + MPUserIdentityCustomerId, + /** User identity Facebook */ + MPUserIdentityFacebook, + /** User identity Twitter */ + MPUserIdentityTwitter, + /** User identity Google */ + MPUserIdentityGoogle, + /** User identity Microsoft */ + MPUserIdentityMicrosoft, + /** User identity Yahoo! */ + MPUserIdentityYahoo, + /** User identity Email */ + MPUserIdentityEmail, + /** User identity Alias */ + MPUserIdentityAlias, + /** User identity Facebook Custom Audience Third Party Id, or User App Id */ + MPUserIdentityFacebookCustomAudienceId, + /** User identity other 2 */ + MPUserIdentityOther2, + /** User identity other 3 */ + MPUserIdentityOther3, + /** User identity other 4 */ + MPUserIdentityOther4 +}; + +/// Kit Instance Codes +typedef NS_ENUM(NSUInteger, MPKitInstance) { + /** Kit code for Urban Airship */ + MPKitInstanceUrbanAirship = 25, + /** Kit code for Appboy */ + MPKitInstanceAppboy = 28, + /** Kit code for Tune */ + MPKitInstanceTune = 32, + /** Kit code for Kochava */ + MPKitInstanceKochava = 37, + /** Kit code for comScore */ + MPKitInstanceComScore = 39, + /** Kit code for Optimizely */ + MPKitInstanceOptimizely = 54, + /** Kit code for Kahuna */ + MPKitInstanceKahuna = 56, + /** Kit code for Nielsen */ + MPKitInstanceNielsen = 63, + /** Kit code for Foresee */ + MPKitInstanceForesee = 64, + /** Kit code for Adjust */ + MPKitInstanceAdjust = 68, + /** Kit code for Branch Metrics */ + MPKitInstanceBranchMetrics = 80, + /** Kit code for Flurry */ + MPKitInstanceFlurry = 83, + /** Kit code for Localytics */ + MPKitInstanceLocalytics = 84, + /** Kit code for Apteligent (formerly known as Crittercism) */ + MPKitInstanceApteligent = 86, + /** Kit code for Crittercism (now Apteligent) */ + MPKitInstanceCrittercism = 86, + /** Kit code for Wootric */ + MPKitInstanceWootric = 90, + /** Kit code for AppsFlyer */ + MPKitInstanceAppsFlyer = 92, + /** Kit code for Apptentive */ + MPKitInstanceApptentive = 97, + /** Kit code for Leanplum */ + MPKitInstanceLeanplum = 98, + /** Kit code for Carnival */ + MPKitInstanceCarnival = 99, + /** Kit code for Primer */ + MPKitInstancePrimer = 100, + /** Kit code for Responsys */ + MPKitInstanceResponsys = 102, + /** Kit code for Apptimize */ + MPKitInstanceApptimize = 105, + /** Kit code for Reveal Mobile */ + MPKitInstanceRevealMobile = 112, + /** Kit code for Radar */ + MPKitInstanceRadar = 117, + /** Kit code for Skyhook */ + MPKitInstanceSkyhook = 121, + /** Kit code for Iterable */ + MPKitInstanceIterable = 1003, + /** Kit code for Button */ + MPKitInstanceButton = 1022, + /** Kit code for Singular */ + MPKitInstanceSingular = 119, + /** Kit code for Adobe */ + MPKitInstanceAdobe = 124, + /** Kit code for Instabot */ + MPKitInstanceInstabot = 123, + /** Kit code for Appsee */ + MPKitInstanceAppsee = 126, + /** Kit code for Taplytics */ + MPKitInstanceTaplytics = 129, + /** Kit code for CleverTap */ + MPKitInstanceCleverTap = 135 +}; + +/// Log Levels +typedef NS_ENUM(NSUInteger, MPILogLevel) { + /** No log messages are displayed on the console */ + MPILogLevelNone = 0, + /** Only error log messages are displayed on the console */ + MPILogLevelError, + /** Warning and error log messages are displayed on the console */ + MPILogLevelWarning, + /** Debug, warning, and error log messages are displayed on the console */ + MPILogLevelDebug, + /** Verbose, debug, warning, and error log messages are displayed on the console */ + MPILogLevelVerbose +}; + +/// Message Types +typedef NS_ENUM(NSUInteger, MPMessageType) { + /** Message type unknown - RESERVED, DO NOT USE */ + MPMessageTypeUnknown = 0, + /** Message type code for a session start */ + MPMessageTypeSessionStart = 1, + /** Message type code for a session end */ + MPMessageTypeSessionEnd = 2, + /** Message type code for a screen view */ + MPMessageTypeScreenView = 3, + /** Message type code for an event */ + MPMessageTypeEvent = 4, + /** Message type code for a crash report */ + MPMessageTypeCrashReport = 5, + /** Message type code for opt out */ + MPMessageTypeOptOut = 6, + /** Message type code for the first time the app is run */ + MPMessageTypeFirstRun = 7, + /** Message type code for attributions */ + MPMessageTypePreAttribution = 8, + /** Message type code for when an app successfully registers to receive push notifications */ + MPMessageTypePushRegistration = 9, + /** Message type code for when an app transitions to/from background */ + MPMessageTypeAppStateTransition = 10, + /** Message type code for when an app receives a push notification */ + MPMessageTypePushNotification = 11, + /** Message type code for logging a network performance measurement */ + MPMessageTypeNetworkPerformance = 12, + /** Message type code for leaving a breadcrumb */ + MPMessageTypeBreadcrumb = 13, + /** Message type code for profile - RESERVED, DO NOT USE */ + MPMessageTypeProfile = 14, + /** Message type code for when a user interacts with a received push notification */ + MPMessageTypePushNotificationInteraction = 15, + /** Message type code for a commerce event */ + MPMessageTypeCommerceEvent = 16, + /** Message type code for a user attribute change */ + MPMessageTypeUserAttributeChange = 17, + /** Message type code for a user identity change */ + MPMessageTypeUserIdentityChange = 18 +}; + +typedef NS_ENUM(NSUInteger, MPConnectivityErrorCode) { + /** Client side error: Unknown error. */ + MPConnectivityErrorCodeUnknown = 0, + /** The device is not online. Please make sure you've initialized the mParticle SDK and that your device has an active network connection. */ + MPConnectivityErrorCodeNoConnection = 1, + /** Client side error: SSL connection failed to be established due to invalid server certificate. mParticle performs SSL pinning - you cannot use a proxy to read traffic. */ + MPConnectivityErrorCodeSSLCertificate = 2, +}; + +typedef NS_ENUM(NSUInteger, MPIdentityErrorResponseCode) { + /** Client side error: Unknown error. */ + MPIdentityErrorResponseCodeUnknown = 0, + /** Client side error: There is a current Identity API request in progress. Please wait until it has completed and retry your request. */ + MPIdentityErrorResponseCodeRequestInProgress = 1, + /** Client side error: Request timed-out while attempting to call the server. Request should be retried when device connectivity has been reestablished. */ + MPIdentityErrorResponseCodeClientSideTimeout = 2, + /** Client side error: Device has no network connection. Request should be retried when device connectivity has been reestablished. */ + MPIdentityErrorResponseCodeClientNoConnection = 3, + /** Client side error: SSL connection failed to be established due to invalid server certificate. mParticle performs SSL pinning - you cannot use a proxy to read traffic. */ + MPIdentityErrorResponseCodeSSLError = 3, + /** Client side error: User has enabled OptOut. */ + MPIdentityErrorResponseCodeOptOut = 4, + /** HTTP Error 401: Unauthorized. Ensure that you've initialized the mParticle SDK with a valid workspace key and secret. */ + MPIdentityErrorResponseCodeUnauthorized = 401, + /** HTTP Error 504: Identity request should be retried */ + MPIdentityErrorResponseCodeTimeout = 504, + /** HTTP Error 429: Identity request should be retried */ + MPIdentityErrorResponseCodeRetry = 429 +}; + +/** Posted immediately after a new session has begun. + + @discussion You can register to receive this notification using NSNotificationCenter. This notification contains a userInfo dictionary, you can + access the respective session id by using the mParticleSessionId constant. + */ +extern NSString * _Nonnull const mParticleSessionDidBeginNotification; + +/** Posted right before the current session ends. + + @discussion You can register to receive this notification using NSNotificationCenter. This notification contains a userInfo dictionary, you can + access the respective session id by using the mParticleSessionId constant. + */ +extern NSString * _Nonnull const mParticleSessionDidEndNotification; + +/** This constant is used as key for the userInfo dictionary in the + mParticleSessionDidBeginNotification and mParticleSessionDidEndNotification notifications. The value + of this key is the id of the session. + */ +extern NSString * _Nonnull const mParticleSessionId; + +/** This constant is used as key for the userInfo dictionary in the + mParticleSessionDidBeginNotification and mParticleSessionDidEndNotification notifications. The value + of this key is the UUID of the session. + */ +extern NSString * _Nonnull const mParticleSessionUUID; + +/** Posted immediately after the SDK becomes initialized. + + @discussion You can register to receive this notification using NSNotificationCenter. This notification is broadcast when the mParticle SDK successfully + finishes its initialization. + */ +extern NSString * _Nonnull const mParticleDidFinishInitializing; + +/** + Set of constants that can be used to specify certain attributes of a user. + + @discussion There are many 3rd party services that support, + for example, specifying a gender of a user. The mParticle platform will look for these constants within the user attributes that + you have set for a given user, and forward any attributes to the services that support them. + mParticleUserAttributeMobileNumber Setting the mobile number as user attribute + mParticleUserAttributeGender Setting the gender as user attribute + mParticleUserAttributeAge Setting the age as user attribute + mParticleUserAttributeCountry Setting the country as user attribute + mParticleUserAttributeZip Setting the postal code (zip) as user attribute + mParticleUserAttributeCity Setting the city as user attribute + mParticleUserAttributeState Setting the state as user attribute + mParticleUserAttributeAddress Setting the address as user attribute + mParticleUserAttributeFirstName Setting the first name as user attribute + mParticleUserAttributeLastName Setting the last name as user attribute + @see setUserAttribute:value: + */ +extern NSString * _Nonnull const mParticleUserAttributeMobileNumber; +extern NSString * _Nonnull const mParticleUserAttributeGender; +extern NSString * _Nonnull const mParticleUserAttributeAge; +extern NSString * _Nonnull const mParticleUserAttributeCountry; +extern NSString * _Nonnull const mParticleUserAttributeZip; +extern NSString * _Nonnull const mParticleUserAttributeCity; +extern NSString * _Nonnull const mParticleUserAttributeState; +extern NSString * _Nonnull const mParticleUserAttributeAddress; +extern NSString * _Nonnull const mParticleUserAttributeFirstName; +extern NSString * _Nonnull const mParticleUserAttributeLastName; + +/** Posted immediately after a kit becomes available to be used. + + @discussion If your app is calling a kit methods directly, you can register to receive this notification + when a kit becomes available for use. The notification contains a userInfo dictionary where you can extract + the associated kit instance with the mParticleKitInstanceKey constant. + @see MPKitInstance + @see mParticleKitInstanceKey + */ +extern NSString * _Nonnull const mParticleKitDidBecomeActiveNotification; +extern NSString * _Nonnull const mParticleEmbeddedSDKDidBecomeActiveNotification; + +/** Posted immediately after a kit becomes unavailable to be used. + + @discussion If your app is calling kit methods directly, you can register to receive this notification + when a kit becomes unavailable for use. You may receive this notification if a kit gets disabled + in the mParticle Services Hub. The notification contains a userInfo dictionary where you can extract + the associated kit instance with the mParticleKitInstanceKey constant. + @see MPKitInstance + @see mParticleKitInstanceKey + */ +extern NSString * _Nonnull const mParticleKitDidBecomeInactiveNotification; +extern NSString * _Nonnull const mParticleEmbeddedSDKDidBecomeInactiveNotification; + +/** + Constant used to extract the respective kit instance number from userInfo dictionary in a + kit notification. + @see mParticleKitDidBecomeActiveNotification + @see mParticleKitDidBecomeInactiveNotification + */ +extern NSString * _Nonnull const mParticleKitInstanceKey; +extern NSString * _Nonnull const mParticleEmbeddedSDKInstanceKey; + +/** Posted immediately after the user's MPID changes (or in other terms when a different user becomes active). + */ +extern NSString * _Nonnull const mParticleIdentityStateChangeListenerNotification; +extern NSString * _Nonnull const mParticleUserKey; +extern NSString * _Nonnull const mParticleIdentityErrorDomain; +extern NSString * _Nonnull const mParticleIdentityErrorKey; + +/** + Constant used to express gender. + */ +extern NSString * _Nonnull const mParticleGenderMale; +extern NSString * _Nonnull const mParticleGenderFemale; +extern NSString * _Nonnull const mParticleGenderNotAvailable; + +/** + Kit API error domain and key + */ +extern NSString * _Nonnull const MPKitAPIErrorDomain; +extern NSString * _Nonnull const MPKitAPIErrorKey; + +#endif diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPEvent.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPEvent.h new file mode 100644 index 0000000..511c710 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPEvent.h @@ -0,0 +1,93 @@ +#import +#import "MPEnums.h" + +/** + This class represents an event to be logged using the mParticle SDK. + */ +@interface MPEvent : NSObject { +@protected + NSDate *_timestamp; + NSString *_typeName; +} + +/** + Setting the category of an MPEvent adds a custom attribute using $Category as the key. Several integrations, such as Google Analytics, + will use this key to perform data mapping. Other integrations will receive the attribute as $Category. + Please reference the mParticle doc site for more information. + */ +@property (nonatomic, strong, nullable) NSString *category; + +/** + Custom flags are a collection of attributes which by default are not forwarded to kits. + */ +@property (nonatomic, strong, readonly, nonnull) NSDictionary *> *customFlags; + +/** + The duration, in milliseconds, of an event. You can set this property directly, or + you can use the beginTiming/endTiming methods and it will be calculated automatically + by the mParticle SDK. + @see beginTiming + */ +@property (nonatomic, strong, nullable) NSNumber *duration; + +/** + If using the beginTiming/endTiming methods, this property contains the time the + event ended. Otherwise it is nil. + */ +@property (nonatomic, strong, nullable) NSDate *endTime; + +/** + A dictionary containing further information about the event. The number of entries is + limited to 100 key value pairs. Keys must be strings (up to 255 characters) and values + can be strings (up to 4096 characters), numbers, booleans, or dates + */ +@property (nonatomic, strong, nullable) NSDictionary *info; + +/** + The name of the event to be logged (required not nil). The event name must not contain + more than 255 characters. + */ +@property (nonatomic, strong, nonnull) NSString *name; + +/** + If using the beginTiming/endTiming methods, this property contains the time the + event started. Otherwise it is nil. + */ +@property (nonatomic, strong, nullable) NSDate *startTime; + +/** + String representation of the event type to be logged. + */ +@property (nonatomic, strong, readonly, nonnull) NSString *typeName; + +/** + An enum value that indicates the type of event to be logged. If logging a screen event, this + property will be overridden to MPEventTypeNavigation. In all other cases the SDK will honor the type + assigned to this property. + @see MPEventType + */ +@property (nonatomic, unsafe_unretained) MPEventType type; + +/** + Initializes an instance of MPEvent + @param name The name of the event to be logged (required not nil). The event name must not contain more than 255 characters. + @param type An enum value that indicates the type of event to be logged. + @returns An instance of MPEvent or nil, if it could not be initialized. + */ +- (nullable instancetype)initWithName:(nonnull NSString *)name type:(MPEventType)type __attribute__((objc_designated_initializer)); + +/** + Adds a custom flag associated with a key to the event. + @param customFlag A string attribute + @param key The key associated with the custom flag. + */ +- (void)addCustomFlag:(nonnull NSString *)customFlag withKey:(nonnull NSString *)key; + +/** + Adds an array of custom flags associated with a key to the event. + @param customFlags An array of string attributes + @param key The key associated with the custom flags. + */ +- (void)addCustomFlags:(nonnull NSArray *)customFlags withKey:(nonnull NSString *)key; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPExtensionProtocol.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPExtensionProtocol.h new file mode 100644 index 0000000..b793810 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPExtensionProtocol.h @@ -0,0 +1,48 @@ +#ifndef mParticle_Apple_SDK_MPExtensionProtocol_h +#define mParticle_Apple_SDK_MPExtensionProtocol_h + +#import +#import "MPKitProtocol.h" + +#pragma mark Extension protocol +@protocol MPExtensionProtocol + +@end + +#pragma mark Extension protocol especialization for kits +@protocol MPExtensionKitProtocol + +/** + Kit code. Obtained from mParticle and informed to the Core SDK + */ +@property (nonatomic, strong, nonnull, readonly) NSNumber *code; + +/** + Instance of the 3rd party kit wrapper implementation. The instance is allocated by the mParticle SDK and uses the class name provided by the className parameter. + You should not set this property. It's lifecycle is managed by the mParticle SDK + @see className + @see MPKitProtocol + */ +@property (nonatomic, strong, nullable) id wrapperInstance; + +/** + Kit name. Obtained from the 3rd party library provider and informed to the Core SDK + */ +@property (nonatomic, strong, nonnull, readonly) NSString *name; + +/** + Name of the class implementing the wrapper to forward calls to 3rd party kits + */ +@property (nonatomic, strong, nonnull, readonly) NSString *className; + +/** + Allocates and initializes a register to a 3rd party kit implementation + @param name Kit name. Obtained from the 3rd party library provider and informed to the Core SDK + @param className Name of the class implementing the wrapper to forward calls to 3rd party kits + @returns An instance of a kit register or nil if a kit register could not be instantiated + */ +- (nullable instancetype)initWithName:(nonnull NSString *)name className:(nonnull NSString *)className; + +@end + +#endif diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPGDPRConsent.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPGDPRConsent.h new file mode 100644 index 0000000..6f3fd12 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPGDPRConsent.h @@ -0,0 +1,18 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Record of consent under the GDPR. + */ +@interface MPGDPRConsent : NSObject + +@property (nonatomic, assign) BOOL consented; +@property (nonatomic, copy, nullable) NSString *document; +@property (nonatomic, copy) NSDate *timestamp; +@property (nonatomic, copy, nullable) NSString *location; +@property (nonatomic, copy, nullable) NSString *hardwareId; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIHasher.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIHasher.h new file mode 100644 index 0000000..78f7631 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIHasher.h @@ -0,0 +1,9 @@ +#import + +@interface MPIHasher : NSObject + ++ (uint64_t)hashFNV1a:(NSData *)data; ++ (NSString *)hashString:(NSString *)stringToHash; ++ (NSString *)hashStringUTF16:(NSString *)stringToHash; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIdentityApi.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIdentityApi.h new file mode 100644 index 0000000..f9562be --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIdentityApi.h @@ -0,0 +1,57 @@ +// +// MPIdentityApi.h +// + + +#import +#import "MParticleUser.h" +#import "MPIdentityApiRequest.h" +#import "FilteredMParticleUser.h" +#import "FilteredMPIdentityApiRequest.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MPIdentityApiResult : NSObject + +@property(nonatomic, strong, readwrite, nonnull) MParticleUser *user; + +@end + +typedef void (^MPIdentityApiResultCallback)(MPIdentityApiResult *_Nullable apiResult, NSError *_Nullable error); + +@interface MPIdentityApi : NSObject + +@property(nonatomic, strong, readonly, nullable) MParticleUser *currentUser; + +@property(nonatomic, strong, readonly, nonnull) NSString *deviceApplicationStamp; + +- (nullable MParticleUser *)getUser:(NSNumber *)mpId; + +- (nonnull NSArray *)getAllUsers; + +- (void)identify:(MPIdentityApiRequest *)identifyRequest completion:(nullable MPIdentityApiResultCallback)completion; + +- (void)identifyWithCompletion:(nullable MPIdentityApiResultCallback)completion; + +- (void)login:(MPIdentityApiRequest *)loginRequest completion:(nullable MPIdentityApiResultCallback)completion; + +- (void)loginWithCompletion:(nullable MPIdentityApiResultCallback)completion; + +- (void)logout:(MPIdentityApiRequest *)logoutRequest completion:(nullable MPIdentityApiResultCallback)completion; + +- (void)logoutWithCompletion:(nullable MPIdentityApiResultCallback)completion; + +- (void)modify:(MPIdentityApiRequest *)modifyRequest completion:(nullable MPIdentityApiResultCallback)completion; + +@end + +@interface MPIdentityHTTPErrorResponse : NSObject + +@property (nonatomic) NSInteger httpCode; +@property (nonatomic, assign) MPIdentityErrorResponseCode code; +@property (nonatomic, nullable) NSString *message; +@property (nonatomic, nullable) NSError *innerError; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIdentityApiRequest.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIdentityApiRequest.h new file mode 100644 index 0000000..f9a79ce --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPIdentityApiRequest.h @@ -0,0 +1,24 @@ +// +// MPIdentityApiRequest.h +// + +#import +#import "MParticleUser.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MPIdentityApiRequest : NSObject + ++ (MPIdentityApiRequest *)requestWithEmptyUser; ++ (MPIdentityApiRequest *)requestWithUser:(MParticleUser *) user; + +- (void)setUserIdentity:(nullable NSString *)identityString identityType:(MPUserIdentity)identityType; + +@property (nonatomic, strong, nullable) NSString *email; +@property (nonatomic, strong, nullable) NSString *customerId; +@property (nonatomic, strong, nullable, readonly) NSMutableDictionary *userIdentities; +@property (nonatomic, copy, nullable) void (^onUserAlias)(MParticleUser *previousUser, MParticleUser *newUser); + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitAPI.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitAPI.h new file mode 100644 index 0000000..35b9457 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitAPI.h @@ -0,0 +1,25 @@ +#import + +@class MPAttributionResult; +@class FilteredMParticleUser; +@protocol MPKitProtocol; + +@interface MPKitAPI : NSObject + +- (void)logError:(NSString *_Nullable)format, ...; +- (void)logWarning:(NSString *_Nullable)format, ...; +- (void)logDebug:(NSString *_Nullable)format, ...; +- (void)logVerbose:(NSString *_Nullable)format, ...; + +- (NSDictionary *_Nullable)integrationAttributes; +- (void)onAttributionCompleteWithResult:(MPAttributionResult *_Nullable)result error:(NSError *_Nullable)error; + +- (FilteredMParticleUser *_Nonnull)getCurrentUserWithKit:(id _Nonnull)kit; +- (nullable NSNumber *)incrementUserAttribute:(NSString *_Nonnull)key byValue:(NSNumber *_Nonnull)value forUser:(FilteredMParticleUser *_Nonnull)filteredUser; +- (void)setUserAttribute:(NSString *_Nonnull)key value:(id _Nonnull)value forUser:(FilteredMParticleUser *_Nonnull)filteredUser; +- (void)setUserAttributeList:(NSString *_Nonnull)key values:(NSArray * _Nonnull)values forUser:(FilteredMParticleUser *_Nonnull)filteredUser; +- (void)setUserTag:(NSString *_Nonnull)tag forUser:(FilteredMParticleUser *_Nonnull)filteredUser; +- (void)removeUserAttribute:(NSString *_Nonnull)key forUser:(FilteredMParticleUser *_Nonnull)filteredUser; + + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitExecStatus.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitExecStatus.h new file mode 100644 index 0000000..3db0141 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitExecStatus.h @@ -0,0 +1,23 @@ +#import + +typedef NS_ENUM(NSUInteger, MPKitReturnCode) { + MPKitReturnCodeSuccess = 0, + MPKitReturnCodeFail, + MPKitReturnCodeCannotExecute, + MPKitReturnCodeUnavailable, + MPKitReturnCodeIncorrectProductVersion, + MPKitReturnCodeRequirementsNotMet +}; + +@interface MPKitExecStatus : NSObject + +@property (nonatomic, strong, readonly, nonnull) NSNumber *integrationId; +@property (nonatomic, unsafe_unretained) MPKitReturnCode returnCode; +@property (nonatomic, unsafe_unretained, readonly) NSUInteger forwardCount; +@property (nonatomic, unsafe_unretained, readonly) BOOL success; + +- (nonnull instancetype)initWithSDKCode:(nonnull NSNumber *)integrationId returnCode:(MPKitReturnCode)returnCode; +- (nonnull instancetype)initWithSDKCode:(nonnull NSNumber *)integrationId returnCode:(MPKitReturnCode)returnCode forwardCount:(NSUInteger)forwardCount; +- (void)incrementForwardCount; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitProtocol.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitProtocol.h new file mode 100644 index 0000000..1cbdb34 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitProtocol.h @@ -0,0 +1,133 @@ +#ifndef mParticle_Apple_SDK_MPKitProtocol_h +#define mParticle_Apple_SDK_MPKitProtocol_h + +#import +#import "MPEnums.h" +#import + +#if TARGET_OS_IOS == 1 + #import +#endif + +@class MPCommerceEvent; +@class MPEvent; +@class MPKitExecStatus; +@class MPUserSegments; +@class MPKitAPI; +@class MPConsentState; +@class FilteredMParticleUser; +@class FilteredMPIdentityApiRequest; + +#if TARGET_OS_IOS == 1 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 + @class UNUserNotificationCenter; + @class UNNotification; + @class UNNotificationResponse; +#endif + + +@protocol MPKitProtocol +#pragma mark - Required methods +@property (nonatomic, unsafe_unretained, readonly) BOOL started; + +- (nonnull MPKitExecStatus *)didFinishLaunchingWithConfiguration:(nonnull NSDictionary *)configuration; + ++ (nonnull NSNumber *)kitCode; + +#pragma mark - Optional methods +@optional + +@property (nonatomic, strong, nonnull) NSDictionary *configuration; +@property (nonatomic, strong, nullable) NSDictionary *launchOptions; +@property (nonatomic, strong, nullable, readonly) id providerKitInstance; +@property (nonatomic, strong, nullable) MPKitAPI *kitApi; + +#pragma mark Kit lifecycle +- (void)start; +- (void)deinit; + +#pragma mark Application +- (nonnull MPKitExecStatus *)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(void(^ _Nonnull)(NSArray * _Nullable restorableObjects))restorationHandler; +- (nonnull MPKitExecStatus *)didUpdateUserActivity:(nonnull NSUserActivity *)userActivity; +- (nonnull MPKitExecStatus *)didBecomeActive; +- (nonnull MPKitExecStatus *)failedToRegisterForUserNotifications:(nullable NSError *)error; +- (nonnull MPKitExecStatus *)handleActionWithIdentifier:(nonnull NSString *)identifier forRemoteNotification:(nonnull NSDictionary *)userInfo; +- (nonnull MPKitExecStatus *)handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(nonnull NSDictionary *)userInfo withResponseInfo:(nonnull NSDictionary *)responseInfo; +- (nonnull MPKitExecStatus *)openURL:(nonnull NSURL *)url options:(nullable NSDictionary *)options; +- (nonnull MPKitExecStatus *)openURL:(nonnull NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(nullable id)annotation; +- (nonnull MPKitExecStatus *)receivedUserNotification:(nonnull NSDictionary *)userInfo; +- (nonnull MPKitExecStatus *)setDeviceToken:(nonnull NSData *)deviceToken; + +#if TARGET_OS_IOS == 1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +- (nonnull MPKitExecStatus *)didRegisterUserNotificationSettings:(nonnull UIUserNotificationSettings *)notificationSettings; +#pragma clang diagnostic pop +#endif + +#pragma mark User Notifications +#if TARGET_OS_IOS == 1 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +- (nonnull MPKitExecStatus *)userNotificationCenter:(nonnull UNUserNotificationCenter *)center willPresentNotification:(nonnull UNNotification *)notification API_AVAILABLE(ios(10.0)); +- (nonnull MPKitExecStatus *)userNotificationCenter:(nonnull UNUserNotificationCenter *)center didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response API_AVAILABLE(ios(10.0)); +#endif + +#pragma mark Location tracking +#if TARGET_OS_IOS == 1 +- (nonnull MPKitExecStatus *)beginLocationTracking:(CLLocationAccuracy)accuracy minDistance:(CLLocationDistance)distanceFilter; +- (nonnull MPKitExecStatus *)endLocationTracking; +- (nonnull MPKitExecStatus *)setLocation:(nonnull CLLocation *)location; +#endif + +#pragma mark Session management +- (nonnull MPKitExecStatus *)beginSession; +- (nonnull MPKitExecStatus *)endSession; + +#pragma mark User attributes and identities +- (nonnull MPKitExecStatus *)incrementUserAttribute:(nonnull NSString *)key byValue:(nonnull NSNumber *)value; +- (nonnull MPKitExecStatus *)removeUserAttribute:(nonnull NSString *)key; +- (nonnull MPKitExecStatus *)setUserAttribute:(nonnull NSString *)key value:(nonnull id)value; +- (nonnull MPKitExecStatus *)setUserAttribute:(nonnull NSString *)key values:(nonnull NSArray *)values; +- (nonnull MPKitExecStatus *)setUserIdentity:(nullable NSString *)identityString identityType:(MPUserIdentity)identityType; +- (nonnull MPKitExecStatus *)setUserTag:(nonnull NSString *)tag; + +- (nonnull MPKitExecStatus *)onIncrementUserAttribute:(nonnull FilteredMParticleUser *)user; +- (nonnull MPKitExecStatus *)onRemoveUserAttribute:(nonnull FilteredMParticleUser *)user; +- (nonnull MPKitExecStatus *)onSetUserAttribute:(nonnull FilteredMParticleUser *)user; +- (nonnull MPKitExecStatus *)onSetUserTag:(nonnull FilteredMParticleUser *)user; + +- (nonnull MPKitExecStatus *)onIdentifyComplete:(nonnull FilteredMParticleUser *)user request:(nonnull FilteredMPIdentityApiRequest *)request; +- (nonnull MPKitExecStatus *)onLoginComplete:(nonnull FilteredMParticleUser *)user request:(nonnull FilteredMPIdentityApiRequest *)request; +- (nonnull MPKitExecStatus *)onLogoutComplete:(nonnull FilteredMParticleUser *)user request:(nonnull FilteredMPIdentityApiRequest *)request; +- (nonnull MPKitExecStatus *)onModifyComplete:(nonnull FilteredMParticleUser *)user request:(nonnull FilteredMPIdentityApiRequest *)request; + +#pragma mark Consent state +- (nonnull MPKitExecStatus *)setConsentState:(nullable MPConsentState *)state; + +#pragma mark e-Commerce +- (nonnull MPKitExecStatus *)logCommerceEvent:(nonnull MPCommerceEvent *)commerceEvent; +- (nonnull MPKitExecStatus *)logLTVIncrease:(double)increaseAmount event:(nonnull MPEvent *)event; + +#pragma mark Events +- (nonnull MPKitExecStatus *)logEvent:(nonnull MPEvent *)event; +- (nonnull MPKitExecStatus *)logInstall; +- (nonnull MPKitExecStatus *)logout; +- (nonnull MPKitExecStatus *)logScreen:(nonnull MPEvent *)event; +- (nonnull MPKitExecStatus *)logUpdate; + +#pragma mark Timed events +- (nonnull MPKitExecStatus *)beginTimedEvent:(nonnull MPEvent *)event; +- (nonnull MPKitExecStatus *)endTimedEvent:(nonnull MPEvent *)event; + +#pragma mark Errors and exceptions +- (nonnull MPKitExecStatus *)leaveBreadcrumb:(nonnull MPEvent *)event; +- (nonnull MPKitExecStatus *)logError:(nullable NSString *)message eventInfo:(nullable NSDictionary *)eventInfo; +- (nonnull MPKitExecStatus *)logException:(nonnull NSException *)exception; + +#pragma mark Assorted +- (nonnull MPKitExecStatus *)setDebugMode:(BOOL)debugMode; +- (nonnull MPKitExecStatus *)setKitAttribute:(nonnull NSString *)key value:(nullable id)value; +- (nonnull MPKitExecStatus *)setOptOut:(BOOL)optOut; +- (nullable NSString *)surveyURLWithUserAttributes:(nonnull NSDictionary *)userAttributes; +- (BOOL) shouldDelayMParticleUpload; +@end + +#endif diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitRegister.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitRegister.h new file mode 100644 index 0000000..0f400e2 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPKitRegister.h @@ -0,0 +1,38 @@ +#import +#import "MPKitProtocol.h" +#import "MPExtensionProtocol.h" + +@interface MPKitRegister : NSObject + +/** + Kit code. Obtained from mParticle and informed to the Core SDK + */ +@property (nonatomic, strong, nonnull, readonly) NSNumber *code; + +/** + Instance of the 3rd party kit wrapper implementation. The instance is allocated by the mParticle SDK and uses the class name provided by the className parameter. + You should not set this property. It's lifecycle is managed by the mParticle SDK + @see className + @see MPKitProtocol + */ +@property (nonatomic, strong, nullable) id wrapperInstance; + +/** + Kit name. Obtained from the 3rd party library provider and informed to the Core SDK + */ +@property (nonatomic, strong, nonnull, readonly) NSString *name; + +/** + Name of the class implementing the wrapper to forward calls to 3rd party kits + */ +@property (nonatomic, strong, nonnull, readonly) NSString *className; + +/** + Allocates and initializes a register to a 3rd party kit implementation + @param name Kit name. Obtained from the 3rd party library provider and informed to the Core SDK + @param className Name of the class implementing the wrapper to forward calls to 3rd party kits + @returns An instance of a kit register or nil if a kit register could not be instantiated + */ +- (nullable instancetype)initWithName:(nonnull NSString *)name className:(nonnull NSString *)className __attribute__((objc_designated_initializer)); + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPProduct+Dictionary.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPProduct+Dictionary.h new file mode 100644 index 0000000..013b377 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPProduct+Dictionary.h @@ -0,0 +1,15 @@ +#import "MPProduct.h" + +@interface MPProduct(Dictionary) + +- (NSDictionary *)commerceDictionaryRepresentation; +- (NSDictionary *)dictionaryRepresentation; +- (NSDictionary *)beautifiedDictionaryRepresentation; +- (void)setTimeAddedToCart:(NSDate *)date; +- (MPProduct *)copyMatchingHashedProperties:(NSDictionary *)hashedMap; +- (NSMutableDictionary *)beautifiedAttributes; +- (void)setBeautifiedAttributes:(NSMutableDictionary *)beautifiedAttributes; +- (NSMutableDictionary *)userDefinedAttributes; +- (void)setUserDefinedAttributes:(NSMutableDictionary *)userDefinedAttributes; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPProduct.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPProduct.h new file mode 100644 index 0000000..4125a0a --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPProduct.h @@ -0,0 +1,189 @@ +#import +/** + This class is used to describe a product used in a commerce event. + Since this class behaves similarly to an NSMutableDictionary, custom key/value pairs can be specified, in addition to the + ones listed as class properties. + + For example: + + Swift +

+ let product = MPProduct(name:"Product Name", sku:"s1k2u3", quantity:1, price:1.23)
+ 
+ product["Custom Key"] = "Custom Value"
+ 
+ + Objective-C +

+ MPProduct *product = [[MPProduct alloc] initWithName:@"Product Name" sku:@"s1k2u3" quantity:@1 price:@1.23];
+ 
+ product[@"Custom Key"] = @"Custom Value";
+ 
+ */ +@interface MPProduct : NSObject + +/** + The product brand + */ +@property (nonatomic, strong, nullable) NSString *brand; + +/** + A category to which the product belongs + */ +@property (nonatomic, strong, nullable) NSString *category; + +/** + The coupon associated with the product + */ +@property (nonatomic, strong, nullable) NSString *couponCode; + +/** + The name of the product + */ +@property (nonatomic, strong, nonnull) NSString *name; + +/** + The price of a product. If product is free or price is non-applicable use nil. Default value is nil + */ +@property (nonatomic, strong, nullable) NSNumber *price; + +/** + SKU of a product. This is the product id + */ +@property (nonatomic, strong, nonnull) NSString *sku; + +/** + The variant of the product + */ +@property (nonatomic, strong, nullable) NSString *variant; + +/** + The prosition of the product on the screen or impression list + */ +@property (nonatomic, unsafe_unretained) NSUInteger position; + +/** + The quantity of the product. Default value is 1 + */ +@property (nonatomic, strong, nonnull) NSNumber *quantity; + +/** + Initializes an instance of MPProduct. + @param name The name of the product + @param sku The SKU or Product Id + @param quantity The quantity of the product. If non-applicable use 0 + @param price The unit price of the product. If the product is free or if non-applicable pass 0 + @returns An instance of MPProduct, or nil if it could not be created + + Swift +

+ let product = MPProduct(name:"Product Name", sku:"s1k2u3", quantity:1, price:1.23)
+ 
+ + Objective-C +

+ MPProduct *product = [[MPProduct alloc] initWithName:@"Product Name" sku:@"s1k2u3" quantity:@1 price:@1.23];
+ 
+ */ +- (nonnull instancetype)initWithName:(nonnull NSString *)name sku:(nonnull NSString *)sku quantity:(nonnull NSNumber *)quantity price:(nullable NSNumber *)price; + +/** + Returns an array with all keys in the MPProduct dictionary + @returns An array with all dictionary keys + */ +- (nonnull NSArray *)allKeys; + +/** + Number of entries in the MPProduct dictionary + @returns The number of entries in the dictionary + */ +- (NSUInteger)count; + +- (nullable id)objectForKeyedSubscript:(nonnull NSString *const)key; +- (void)setObject:(nonnull id)obj forKeyedSubscript:(nonnull NSString *)key; + +#pragma mark Deprecated and/or Unavailable +/** + An entity with which the transaction should be affiliated (e.g. a particular store). If nil, mParticle will use an empty string + @deprecated use MPTransactionAttributes.affiliation instead + */ +@property (nonatomic, strong, nullable) NSString *affiliation __attribute__((deprecated("use MPTransactionAttributes.affiliation instead"))); + +/** + The currency of a transaction. If not specified, mParticle will use "USD" + @deprecated use MPCommerceEvent.currency instead + */ +@property (nonatomic, strong, nullable) NSString *currency __attribute__((deprecated("use MPCommerceEvent.currency instead"))); + +/** + A unique ID representing the transaction. This ID should not collide with other transaction IDs. If not specified, mParticle will generate a random id with 20 characters + @deprecated use MPTransactionAttributes.transactionId instead + */ +@property (nonatomic, strong, nullable) NSString *transactionId __attribute__((deprecated("use MPTransactionAttributes.transactionId instead"))); + +/** + @deprecated use MPTransactionAttributes.revenue instead + */ +@property (nonatomic, readwrite) double revenueAmount __attribute__((unavailable("use MPTransactionAttributes.revenue instead"))); + +/** + The total cost of shipping for a transaction. If free or non-applicable use 0. Default value is zero + @deprecated use MPTransactionAttributes.shipping instead + */ +@property (nonatomic, readwrite) double shippingAmount __attribute__((deprecated("use MPTransactionAttributes.shipping instead"))); + +/** + The total tax for a transaction. If free or non-applicable use 0. Default value is zero + @deprecated use MPTransactionAttributes.tax instead + */ +@property (nonatomic, readwrite) double taxAmount __attribute__((deprecated("use MPTransactionAttributes.tax instead"))); + +/** + The total value of a transaction, including tax and shipping. If free or non-applicable use 0. Default value is zero + @deprecated use MPTransactionAttributes.revenue instead + */ +@property (nonatomic, readwrite) double totalAmount __attribute__((deprecated("use MPTransactionAttributes.revenue instead"))); + +/** + The price of a product. If product is free or price is non-applicable use 0. Default value is zero + @deprecated use the price property instead + */ +@property (nonatomic, readwrite) double unitPrice __attribute__((deprecated("use the price property instead"))); + +/** + @deprecated use initWithName:sku:quantity:price: instead + */ +- (nonnull instancetype)initWithName:(nonnull NSString *)name category:(nullable NSString *)category quantity:(NSInteger)quantity totalAmount:(double)totalAmount __attribute__((unavailable("use initWithName:sku:quantity:price: instead"))); + +/** + @deprecated use initWithName:sku:quantity:price: instead + */ +- (nonnull instancetype)initWithName:(nonnull NSString *)name category:(nullable NSString *)category quantity:(NSInteger)quantity revenueAmount:(double)revenueAmount __attribute__((unavailable("use initWithName:sku:quantity:price: instead"))); + +@end + +// Internal +extern NSString * _Nonnull const kMPProductName; +extern NSString * _Nonnull const kMPProductSKU; +extern NSString * _Nonnull const kMPProductUnitPrice; +extern NSString * _Nonnull const kMPProductQuantity; +extern NSString * _Nonnull const kMPProductRevenue; +extern NSString * _Nonnull const kMPProductCategory; +extern NSString * _Nonnull const kMPProductTotalAmount; +extern NSString * _Nonnull const kMPProductTransactionId; +extern NSString * _Nonnull const kMPProductAffiliation; +extern NSString * _Nonnull const kMPProductCurrency; +extern NSString * _Nonnull const kMPProductTax; +extern NSString * _Nonnull const kMPProductShipping; + +// Expanded +extern NSString * _Nonnull const kMPExpProductBrand; +extern NSString * _Nonnull const kMPExpProductName; +extern NSString * _Nonnull const kMPExpProductSKU; +extern NSString * _Nonnull const kMPExpProductUnitPrice; +extern NSString * _Nonnull const kMPExpProductQuantity; +extern NSString * _Nonnull const kMPExpProductCategory; +extern NSString * _Nonnull const kMPExpProductCouponCode; +extern NSString * _Nonnull const kMPExpProductVariant; +extern NSString * _Nonnull const kMPExpProductPosition; +extern NSString * _Nonnull const kMPExpProductTotalAmount; diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPPromotion.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPPromotion.h new file mode 100644 index 0000000..15c10c8 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPPromotion.h @@ -0,0 +1,125 @@ +#import + +typedef NS_ENUM(NSUInteger, MPPromotionAction) { + MPPromotionActionClick = 0, + MPPromotionActionView +}; + + +#pragma mark - MPPromotion +/** + This class describes a promotion. + + Usage: + + Swift +

+ let promotion = MPPromotion()
+
+ promotion.promotionId = "xyz123"
+ 
+ promotion.name = "Promotion name"
+ 
+ promotion.position = "bottom banner"
+ 
+ + Objective-C +

+ MPPromotion *promotion = [[MPPromotion alloc] init];
+ 
+ promotion.promotionId = @"xyz123";
+ 
+ promotion.name = @"Promotion name";
+ 
+ promotion.position = @"bottom banner";
+ 
+ + @see MPPromotionContainer + */ +@interface MPPromotion : NSObject + +/** + Description for the promotion creative. + */ +@property (nonatomic, strong, nullable) NSString *creative; + +/** + Promotion name. + */ +@property (nonatomic, strong, nullable) NSString *name; + +/** + Promotion display position. + */ +@property (nonatomic, strong, nullable) NSString *position; + +/** + Promotion identifier. + */ +@property (nonatomic, strong, nullable) NSString *promotionId; + +@end + + +#pragma mark - MPPromotionContainer +/** + This class is a container for the information that represents a collection of promotions (one or more). + + Usage: + + Swift +

+ let promotionContainer = MPPromotionContainer(action: MPPromotionAction.View, promotion: promotion1)
+ 
+ let commerceEvent = MPCommerceEvent(promotionContainer: promotionContainer)
+ 
+ let mParticle = MParticle.sharedInstance()
+ 
+ mParticle.logCommerceEvent(commerceEvent)
+ 
+ + Objective-C +

+ MPPromotionContainer *promotionContainer = [[MPPromotionContainer alloc] initWithAction:MPPromotionActionView promotion:promotion1];
+ 
+ MPCommerceEvent *commerceEvent = [[MPCommerceEvent alloc] initWithPromotionContainer:promotionContainer];
+ 
+ MParticle *mParticle = [MParticle sharedInstance];
+ 
+ [mParticle logCommerceEvent:commerceEvent];
+ 
+ + @see MPPromotion + @see MPCommerceEvent + @see mParticle + */ +@interface MPPromotionContainer : NSObject + +/** + List of promotions under an action + */ +@property (nonatomic, strong, readonly, nullable) NSArray *promotions; + +/** + A value from the MPPromotionAction enum describing the promotion action. + */ +@property (nonatomic, unsafe_unretained, readonly) MPPromotionAction action; + +/** + Initializes an instance of MPPromotionContainer with an action and a promotion. + + @param action A value from the MPPromotionAction enum describing the promotion action + @param promotion An instance of MPPromotion + + @see MPPromotionAction + */ +- (nonnull instancetype)initWithAction:(MPPromotionAction)action promotion:(nullable MPPromotion *)promotion; + +/** + Adds a promotion to the list of promotions to have action applied to. + + @param promotion An instance of MPPromotion + */ +- (void)addPromotion:(nonnull MPPromotion *)promotion; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPTransactionAttributes+Dictionary.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPTransactionAttributes+Dictionary.h new file mode 100644 index 0000000..18785eb --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPTransactionAttributes+Dictionary.h @@ -0,0 +1,8 @@ +#import "MPTransactionAttributes.h" + +@interface MPTransactionAttributes(Dictionary) + +- (NSDictionary *)dictionaryRepresentation; +- (NSDictionary *)beautifiedDictionaryRepresentation; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPTransactionAttributes.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPTransactionAttributes.h new file mode 100644 index 0000000..55f26aa --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPTransactionAttributes.h @@ -0,0 +1,76 @@ +#import + +/** + This class represents the atributes of a commerce event transaction. It is used in conjunction with MPCommerceEvent to represent a commerce event transaction. + + Usage: + + Swift +

+ let transactionAttributes = MPTransactionAttributes()
+ 
+ transactionAttributes.transactionId = "abc987"
+ 
+ transactionAttributes.revenue = 31.41
+ 
+ transactionAttributes.tax = 2.51
+ 
+ transactionAttributes.affiliation = "Awesome Company, Inc."
+ 
+ + Objective-C +

+ MPTransactionAttributes *transactionAttributes = [[MPTransactionAttributes alloc] init];
+ 
+ transactionAttributes.transactionId = @"abc987";
+ 
+ transactionAttributes.revenue = @31.41;
+ 
+ transactionAttributes.tax = @2.51;
+ 
+ transactionAttributes.affiliation = @"Awesome Company, Inc.";
+ 
+ + @see MPCommerceEvent + */ +@interface MPTransactionAttributes : NSObject + +/** + A string describing the affiliation. + */ +@property (nonatomic, strong, nullable) NSString *affiliation; + +/** + The coupon code string. + */ +@property (nonatomic, strong, nullable) NSString *couponCode; + +/** + The shipping amount of the commerce event transaction. + */ +@property (nonatomic, strong, nullable) NSNumber *shipping; + +/** + The tax amount of the commerce event transaction. + */ +@property (nonatomic, strong, nullable) NSNumber *tax; + +/** + The revenue amount of the commerce event transaction. It usually is the sum(products x quantities) + tax + shipping. + However it may contain other values not listed in the formula, it will vary per company. + */ +@property (nonatomic, strong, nullable) NSNumber *revenue; + +/** + The unique identifier for the commerce event transaction. + */ +@property (nonatomic, strong, nullable) NSString *transactionId; + +@end + +extern NSString * _Nonnull const kMPExpTAAffiliation; +extern NSString * _Nonnull const kMPExpTAShipping; +extern NSString * _Nonnull const kMPExpTATax; +extern NSString * _Nonnull const kMPExpTARevenue; +extern NSString * _Nonnull const kMPExpTATransactionId; +extern NSString * _Nonnull const kMPExpTACouponCode; diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPUserSegments.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPUserSegments.h new file mode 100644 index 0000000..8688b36 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MPUserSegments.h @@ -0,0 +1,39 @@ +#import + +@class MPSegment; + +/** + This class is returned as response from a user segments call. It contains segment ids, expiration, and a flag indicating whether it is expired. + */ +@interface MPUserSegments : NSObject + +/** + The list of user segment ids + */ +@property (nonatomic, strong, readonly, nullable) NSArray *segmentsIds; + +/** + Contains the date the user segment will expire. If nil, it means the user segment doesn't expire + */ +@property (nonatomic, strong, readonly, nullable) NSDate *expiration; + +/** + Flag indicating whether the user segment is expired or not + */ +@property (nonatomic, readonly) BOOL expired; + +/** + Returns a string with a comma separated list of user segment ids. The same user segment ids in the segmentsIds property + */ +- (nullable NSString *)commaSeparatedSegments; + +@end + +/** + User Segments callback handler. + + @param userSegments An array of MPUserSegment objects + @param error Contains nil or an error object + */ +typedef void(^MPUserSegmentsHandler)(MPUserSegments * _Nullable userSegments, NSError * _Nullable error); + diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MParticleUser.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MParticleUser.h new file mode 100644 index 0000000..c28901b --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/MParticleUser.h @@ -0,0 +1,109 @@ +// +// MParticleUser.h +// +// + +#import +#import "MPUserSegments.h" +#import "MPEnums.h" +#import "MPCart.h" +#import "MPConsentState.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MParticleUser : NSObject + +@property(readonly, strong, nonnull) NSNumber *userId; + +/** + Returns whether this user is currently logged in + */ +@property(readonly) BOOL isLoggedIn; + +/** + Gets current user identities (readonly) + @returns A dictionary containing the collection of user identities + @see MPUserIdentity + */ +@property (readonly, strong, nonnull) NSDictionary *userIdentities; + +/** + Gets/sets all user attributes. + @returns A dictionary containing the collection of user attributes. + */ +@property (readwrite, strong, nonnull) NSDictionary *userAttributes; + +/** + Gets the user's shopping cart + @returns An MPCart object + */ +@property (readonly, strong, nonnull) MPCart *cart; + +/** + Increments the value of a user attribute by the provided amount. If the key does not + exist among the current user attributes, this method will add the key to the user attributes + and set the value to the provided amount. If the key already exists and the existing value is not + a number, the operation will abort. + + Note: this method has been changed to be async, return value will always be @0. + + @param key The attribute key + @param value The increment amount + @returns The static value @0 + */ +- (nullable NSNumber *)incrementUserAttribute:(NSString *)key byValue:(NSNumber *)value; + +/** + Sets a single user attribute. The property will be combined with any existing attributes. + There is a 100 count limit to user attributes. + @param key The user attribute key + @param value The user attribute value + */ +- (void)setUserAttribute:(NSString *)key value:(id)value; + +/** + Sets a list of user attributes associated with a key. + @param key The user attribute list key + @param values An array of user attributes + */ +- (void)setUserAttributeList:(NSString *)key values:(NSArray *)values; + +/** + Sets a single user tag or attribute. The property will be combined with any existing attributes. + There is a 100 count limit to user attributes. + @param tag The user tag/attribute + */ +- (void)setUserTag:(NSString *)tag; + +/** + Removes a single user attribute. + @param key The user attribute key + */ +- (void)removeUserAttribute:(NSString *)key; + +#pragma mark - User Segments +/** + Retrieves user segments from mParticle's servers and returns the result as an array of MPUserSegments objects. + If the method takes longer than timeout seconds to return, the local cached segments will be returned instead, + and the newly retrieved segments will update the local cache once the results arrive. + @param timeout The maximum number of seconds to wait for a response from mParticle's servers. This value can be fractional, like 0.1 (100 milliseconds) + @param endpointId The endpoint id + @param completionHandler A block to be called when the results are available. The user segments array is passed to this block + */ +- (void)userSegments:(NSTimeInterval)timeout endpointId:(NSString *)endpointId completionHandler:(MPUserSegmentsHandler)completionHandler __attribute__((deprecated(""))); + +#pragma mark - Consent State +/** + Sets the user's current consent state. + @param state A consent state object + */ +- (void)setConsentState:(MPConsentState *)state; +/** + Gets the users consent state. + @returns The user's current consent state object + */ +- (nullable MPConsentState *)consentState; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/NSArray+MPCaseInsensitive.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/NSArray+MPCaseInsensitive.h new file mode 100644 index 0000000..cabf325 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/NSArray+MPCaseInsensitive.h @@ -0,0 +1,7 @@ +#import + +@interface NSArray (MPCaseInsensitive) + +- (BOOL)caseInsensitiveContainsObject:(nonnull NSString *)object; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/NSDictionary+MPCaseInsensitive.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/NSDictionary+MPCaseInsensitive.h new file mode 100644 index 0000000..1a08159 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/NSDictionary+MPCaseInsensitive.h @@ -0,0 +1,9 @@ +#import + +@interface NSDictionary(MPCaseInsensitive) + +- (nullable NSString *)caseInsensitiveKey:(nonnull NSString *)key; +- (nullable id)valueForCaseInsensitiveKey:(nonnull NSString *)key; +- (nonnull NSDictionary *)transformValuesToString; + +@end diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/mParticle.h b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/mParticle.h new file mode 100644 index 0000000..0f38a04 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Headers/mParticle.h @@ -0,0 +1,924 @@ +#import "MPCart.h" +#import "MPCommerce.h" +#import "MPCommerceEvent.h" +#import "MPCommerceEventInstruction.h" +#import "MPCommerceEvent+Dictionary.h" +#import "MPDateFormatter.h" +#import "MPEnums.h" +#import "MPEvent.h" +#import "MPExtensionProtocol.h" +#import +#import "MPIHasher.h" +#import "MPKitExecStatus.h" +#import "MPKitRegister.h" +#import "MPProduct.h" +#import "MPProduct+Dictionary.h" +#import "MPPromotion.h" +#import "MPTransactionAttributes.h" +#import "MPTransactionAttributes+Dictionary.h" +#import "NSArray+MPCaseInsensitive.h" +#import "NSDictionary+MPCaseInsensitive.h" +#import "MPIdentityApi.h" +#import "MPKitAPI.h" +#import "MPConsentState.h" +#import "MPGDPRConsent.h" +#import + +#if TARGET_OS_IOS == 1 + #import + #import +#endif + +#if TARGET_OS_IOS == 1 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 + #import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + An SDK session. + + Sessions are typically started and ended automatically by the SDK based on App lifecycle events. + + Automatic session management can be disabled if desired and is always disabled in App Extensions. + + @see currentSession + */ +@interface MParticleSession : NSObject + +/** + A hash of the session UUID. + */ +@property (nonatomic, readonly) NSNumber *sessionID; + +/** + The session UUID. + */ +@property (nonatomic, readonly) NSString *UUID; + +@end + +/** + Attribution information returned by a kit. + */ +@interface MPAttributionResult : NSObject + +/** + Free-form attribution info dictionary. + */ +@property (nonatomic) NSDictionary *linkInfo; +@property (nonatomic, readonly) NSNumber *kitCode; +@property (nonatomic, readonly) NSString *kitName; + +@end + +/** + Allows you to override the default HTTPS hosts and certificates used by the SDK. + */ +@interface MPNetworkOptions : NSObject + +@property (nonatomic) NSString *configHost; +@property (nonatomic) NSString *eventsHost; +@property (nonatomic) NSString *identityHost; +@property (nonatomic) NSArray *certificates; + +@property (nonatomic) BOOL pinningDisabledInDevelopment; + +@end + +/** + Main configuration object for initial SDK setup. + */ +@interface MParticleOptions : NSObject + +/** + Creates an options object with your specified App key and Secret. + + These values can be retrieved from your App's dashboard within the mParticle platform. + */ ++ (MParticleOptions*)optionsWithKey:(NSString *)apiKey secret:(NSString *)secret; + +/* + App key. mParticle uses this to attribute incoming data to your app's acccount/workspace/platform. + */ +@property (nonatomic, strong, readwrite) NSString *apiKey; + +/* + App secret. An additional authentication token used to produce a signature header required by the server. + */ +@property (nonatomic, strong, readwrite) NSString *apiSecret; + +/* + If you have an App and App Extension, setting this value will share user defaults data between them. + */ +@property (nonatomic, strong, readwrite) NSString *sharedGroupID; + + +/* + Allows you to specify a specific installation type, or specify that the SDK should detect automatically. + + You can specify that this is a known-install, known-upgrade or known-same-version. + + For the first release of your app with the SDK, all users will appear as new to the SDK since it has no persistence. + To avoid inflated install count, you will want to override this setting from autodetect and specifically + tell the SDK whether or not this is an install, based on your app's existing persistence mechanisms. + + For future releases, the mParticle SDK will already be in the installed app, so you can change this value back to auto detect. + */ +@property (nonatomic, unsafe_unretained, readwrite) MPInstallationType installType; + +/* + This identity request object allows you to customize the information included in the initial Identify request sent by the SDK. + */ +@property (nonatomic, strong, readwrite) MPIdentityApiRequest *identifyRequest; + +/* + SDK Environment. Autodetected as development or production, you can also override. + */ +@property (nonatomic, unsafe_unretained, readwrite) MPEnvironment environment; + +/* + Whether the SDK should automatically collect UIApplicationDelegate information. + + If set to NO, you will need to manually add some calls to the SDK within certain AppDelegate methods. + If set to YES (the default), the SDK will intercept app delegate messages before forwarding them to your app. + + This mechanism is acheived using NSProxy and without introducing dangerous swizzling. + */ +@property (nonatomic, unsafe_unretained, readwrite) BOOL proxyAppDelegate; + +/* + Whether the SDK should automatically attempt to measure sessions. Ignored in App Extensions. + + If set to YES, the SDK will start a timer when the app enters the background and will end the session if a + user leaves the app for a configurable number of seconds without bringing it back to foreground. + + Note that the above behavior does not apply to apps with long-running background sessions. + */ +@property (nonatomic, unsafe_unretained, readwrite) BOOL automaticSessionTracking; + +/* + The browser user agent. + + This is normally collected by the SDK automatically. If you are already incurring the cost of instantiating + a webview to collect this, and wish to avoid the performance cost of duplicate work, (or if you need to customize + the value) you can pass this into the SDK as a string. + */ +@property (atomic, strong, nullable) NSString *customUserAgent; + +/* + Whether browser user agent should be collected by the SDK. This value is ignored (always NO) if you specify a non-nil custom user agent. + */ +@property (atomic, unsafe_unretained, readwrite) BOOL collectUserAgent; + +/* + Whether the SDK should attempt to collect Apple Search Ads attribution information. Defaults to YES + */ +@property (atomic, unsafe_unretained, readwrite) BOOL collectSearchAdsAttribution; + +/** + Determines whether the mParticle Apple SDK will automatically track Remote and Local Notification events. Defaults to YES + */ +@property (atomic, unsafe_unretained, readwrite) BOOL trackNotifications; + +/* + This value is not currently read by the SDK and should not be used at this time. + */ +@property (atomic, unsafe_unretained, readwrite) BOOL startKitsAsync; + +/* + Log level. (Defaults to 'None'.) + + This controls the verbosity of the SDK. + + By default the SDK will produce no output. If you modify this for your development builds, please consider using + a preprocessor directive or similar mechanism to ensure your change is not accidentally applied in production. + */ +@property (atomic, unsafe_unretained, readwrite) MPILogLevel logLevel; + +/** + Upload interval. + + Batches of data are sent periodically to the mParticle servers at the rate defined by this property. Batches are also uploaded + when the application is sent to the background. + */ +@property (atomic, unsafe_unretained, readwrite) NSTimeInterval uploadInterval; + +/** + Allows you to override the default HTTPS hosts and certificates used by the SDK, if required. + + (Provided to accomodate certain advanced use cases. Most integrations of the SDK will not require modifying this property.) + */ +@property (nonatomic, strong, readwrite) MPNetworkOptions *networkOptions; + +/** + Consent state. + + Allows you to record one or more consent purposes and whether or not the user agreed to each one. + */ +@property (atomic, strong, nullable) MPConsentState *consentState; + +/** + Identify callback. + + This will be called when an identify request completes. + + This applies to both the initial identify request triggered by the SDK and any identify requests you may send. + */ +@property (nonatomic, copy) void (^onIdentifyComplete)(MPIdentityApiResult *_Nullable apiResult, NSError *_Nullable error); + +/** + Attribution callback. + + This will be called each time a kit returns attribution info. + */ +@property (nonatomic, copy) void (^onAttributionComplete)(MPAttributionResult *_Nullable attributionResult, NSError *_Nullable error); + +@end + +/** + This is the main class of the mParticle SDK. It interfaces your app with the mParticle API + so you can report and measure the many different metrics of your app. + + Usage: + + Swift +

+ let mParticle = MParticle.sharedInstance()
+ 
+ + Objective-C +

+ MParticle *mParticle = [MParticle sharedInstance];
+ 
+ */ +@interface MParticle : NSObject + +#pragma mark Properties + +/** + This property is an instance of MPCommerce. It is used to execute transactional operations on the shopping cart. + @see MPCommerce + @see MPCart + */ +@property (nonatomic, strong, readonly) MPCommerce *commerce; + +/** + This property is an instance of MPIdentityApi. It allows tracking login, logout, and identity changes. + @see MPIdentityApi + @see MParticleUser + */ +@property (nonatomic, strong, readonly) MPIdentityApi *identity; + +/** + Forwards setting/resetting the debug mode for third party kits. + This is a write only property. + */ +@property (nonatomic, unsafe_unretained) BOOL debugMode; +- (BOOL)debugMode UNAVAILABLE_ATTRIBUTE; + +/** + Enables or disables log outputs to the console. If set to YES development logs will be output to the + console, if set to NO the development logs will be suppressed. This property works in conjunction with + the environment property. If the environment is Production, consoleLogging will always be NO, + regardless of the value you assign to it. + @see environment + @see logLevel + */ +@property (nonatomic, unsafe_unretained) BOOL consoleLogging; + +/** + The environment property returns the running SDK environment: Development or Production. + @see MPEnvironment + @see startWithOptions: + */ +@property (nonatomic, unsafe_unretained, readonly) MPEnvironment environment; + +/** + Flag indicating whether the mParticle SDK has been fully initialized yet or not. You can KVO this property to know when the SDK + successfully finishes initializing + */ +@property (nonatomic, unsafe_unretained, readonly) BOOL initialized; + +/** + Specifies the log level output to the console while the app is under development: none, error, warning, and debug. + If consoleLogging is set to false, the log level will be set to none automatically. When the environment is + Production, the log level will always be none, regardless of the value you assign to it. + @see environment + */ +@property (nonatomic, unsafe_unretained) MPILogLevel logLevel; + +/** + Gets/Sets the opt-in/opt-out status for the application. Set it to YES to opt-out of event tracking. Set it to NO to opt-in of event tracking. + The default value is NO (opt-in of event tracking) + */ +@property (nonatomic, unsafe_unretained, readwrite) BOOL optOut; + +/** + A flag indicating whether the mParticle Apple SDK has proxied the App Delegate and is handling + application notifications automatically. + @see startWithOptions: + */ +@property (nonatomic, unsafe_unretained, readonly) BOOL proxiedAppDelegate; + +/** + A flag indicating whether the mParticle Apple SDK is using + automated Session tracking. + @see MParticleOptions + */ +@property (nonatomic, unsafe_unretained, readonly) BOOL automaticSessionTracking; + +/** + The current session. You can access properties for Session ID and UUID. + */ +@property (atomic, strong, nullable, readonly) MParticleSession *currentSession; + +/** + Gets/Sets the user agent to a custom value. + */ +@property (atomic, strong, nullable) NSString *customUserAgent; + +/** + Determines whether the mParticle Apple SDK will instantiate a UIWebView in order to collect the browser user agent. + This value is required by attribution providers for fingerprint identification, when device IDs are not available. + If you disable this flag, consider populating the user agent via the customUserAgent property above if you are using + an attribution provider (such as Kochava or Tune) via mParticle. Defaults to YES + */ +@property (atomic, unsafe_unretained, readwrite) BOOL collectUserAgent; + +/* + Determines whether the SDK will attempt to collect Apple Search Ads attribution information. Defaults to YES + */ +@property (atomic, unsafe_unretained, readwrite) BOOL collectSearchAdsAttribution; + +/** + Allows you to proxy SDK traffic by overriding the default network endpoints and certificates used by the SDK. + @see MParticleOptions + */ +@property (nonatomic, readonly) MPNetworkOptions *networkOptions; + + #if TARGET_OS_IOS == 1 + /** + Gets/Sets the push notification token for the application. + */ +@property (nonatomic, strong, nullable) NSData *pushNotificationToken; +#endif + +/** + Determines whether the mParticle Apple SDK will automatically track Remote and Local Notification events. Defaults to YES + */ +@property (atomic, unsafe_unretained, readonly) BOOL trackNotifications; + +/** + Gets/Sets the user session timeout interval. A session is ended if the app goes into the background for longer than the session timeout interval or + when more than 1000 events are logged. + */ +@property (nonatomic, unsafe_unretained, readwrite) NSTimeInterval sessionTimeout; + +/** + Unique identifier for this app running on this device. This unique identifier is synchronized with the mParticle servers. + @returns A string containing the unique identifier or nil, if communication with the server could not yet be established. + */ +@property (nonatomic, strong, readonly, nullable) NSString *uniqueIdentifier; + +/** + Gets/Sets the interval to upload data to mParticle servers. + + Batches of data are sent periodically to the mParticle servers at the rate defined by the uploadInterval. Batches are also uploaded + when the application is sent to the background or before they are terminated. + */ +@property (nonatomic, unsafe_unretained, readwrite) NSTimeInterval uploadInterval; + + + +/** + mParticle Apple SDK version + */ +@property (nonatomic, strong, readonly) NSString *version; + +#pragma mark - Initialization + +/** + Returns the shared instance object. + @returns the Singleton instance of the MParticle class. + */ ++ (instancetype)sharedInstance; + +/** + * + */ +- (void)start; + +/** + Starts the SDK with your API key and secret and installation type. + It is required that you use either this method or `start` to authorize the SDK before + using the other API methods. The apiKey and secret that are passed in to this method + will override the api_key and api_secret parameters of the (optional) MParticleConfig.plist. + @param options SDK startup options + */ +- (void)startWithOptions:(MParticleOptions *)options; + +#pragma mark - Application notifications +#if TARGET_OS_IOS == 1 + +/** + Informs the mParticle SDK a remote notification has been received. This method should be called only if proxiedAppDelegate is disabled. + @param userInfo A dictionary containing information related to the remote notification + @see proxiedAppDelegate + */ +- (void)didReceiveRemoteNotification:(NSDictionary *)userInfo; + +/** + Informs the mParticle SDK the push notification service could not complete the registration process. This method should be called only if proxiedAppDelegate is disabled. + @param error An NSError object encapsulating the information why registration did not succeed + @see proxiedAppDelegate + */ +- (void)didFailToRegisterForRemoteNotificationsWithError:(nullable NSError *)error; + +/** + Informs the mParticle SDK the app successfully registered with the push notification service. This method should be called only if proxiedAppDelegate is disabled. + @param deviceToken A token that identifies the device+App to APNS + @see proxiedAppDelegate + */ +- (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; + +/** + Informs the mParticle SDK the app has been activated because the user selected a custom action from the alert panel of a remote notification. + This method should be called only if proxiedAppDelegate is disabled. + @param identifier The identifier associated with the custom action + @param userInfo A dictionary that contains information related to the remote notification + @see proxiedAppDelegate + */ +- (void)handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(nullable NSDictionary *)userInfo; + +/** + Informs the mParticle SDK the app has been activated because the user selected a custom action from the alert panel of a remote notification. + This method should be called only if proxiedAppDelegate is disabled. + @param identifier The identifier associated with the custom action + @param userInfo A dictionary that contains information related to the remote notification + @param responseInfo The data dictionary sent by the action + @see proxiedAppDelegate + */ +- (void)handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(nullable NSDictionary *)userInfo withResponseInfo:(nonnull NSDictionary *)responseInfo; + +#endif + +/** + Informs the mParticle SDK the app has been asked to open a resource identified by a URL. + This method should be called only if proxiedAppDelegate is disabled. + @param url The URL resource to open + @param sourceApplication The bundle ID of the requesting app + @param annotation A property list object supplied by the source app + @see proxiedAppDelegate + */ +- (void)openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(nullable id)annotation; + +/** + Informs the mParticle SDK the app has been asked to open a resource identified by a URL. + This method should be called only if proxiedAppDelegate is disabled. This method is only available for iOS 9 and above. + @param url The URL resource to open + @param options The dictionary of launch options + @see proxiedAppDelegate + */ +- (void)openURL:(NSURL *)url options:(nullable NSDictionary *)options; + +/** + Informs the mParticle SDK the app has been asked to open to continue an NSUserActivity. + This method should be called only if proxiedAppDelegate is disabled. This method is only available for iOS 9 and above. + @param userActivity The NSUserActivity that caused the app to be opened + @param restorationHandler A block to execute if your app creates objects to perform the task. + @see proxiedAppDelegate + */ +- (BOOL)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(void(^ _Nonnull)(NSArray * _Nullable restorableObjects))restorationHandler; + +/** + This method will permanently remove ALL MParticle data from the device, including MParticle UserDefaults and Database, it will also halt any further upload or download behavior that may be prepared + + If you have any reference to the MParticle instance, you must remove your reference by setting it to "nil", in order to avoid any unexpected behavior + The SDK will be shut down and [MParticle sharedInstance] will return a new instance without apiKey or secretKey. MParticle can be restarted by calling MParticle.startWithOptions + */ +- (void)reset; + +#pragma mark - Basic Tracking +/** + Contains a collection with all active timed events (timed events that had begun, but not yet ended). You should not keep a + separate reference collection containing the events being timed. The mParticle SDK manages the lifecycle of those events. + @see beginTimedEvent: + @returns A set with all active timed events + */ +- (nullable NSSet *)activeTimedEvents; + +/** + Begins timing an event. There can be many timed events going on at the same time, the only requirement is that each + concurrent timed event must have a unique event name. After beginning a timed event you don't have to keep a reference + to the event instance being timed, you can use the eventWithName: method to retrieve it later when ending the timed event. + @param event An instance of MPEvent + @see MPEvent + */ +- (void)beginTimedEvent:(MPEvent *)event; + +/** + Ends timing an event and logs its data to the mParticle SDK. If you didn't keep a reference to the event + being timed, you can use the eventWithName: method to retrieve it. + @param event An instance of MPEvent + @see beginTimedEvent: + */ +- (void)endTimedEvent:(MPEvent *)event; + +/** + When working with timed events you don't need to keep a reference to the event being timed. You can use this method + to retrieve the event being timed passing the event name as parameter. If an instance of MPEvent, with a matching + event name cannot be found, this method will return nil. + @param eventName A string with the event name associated with the event being timed + @returns An instance of MPEvent, if one could be found, or nil. + @see endTimedEvent: + */ +- (nullable MPEvent *)eventWithName:(NSString *)eventName; + +/** + Logs an event. This is one of the most fundamental methods of the SDK. You can define all the characteristics + of an event (name, type, attributes, etc) in an instance of MPEvent and pass that instance to this method to + log its data to the mParticle SDK. + @param event An instance of MPEvent + @see MPEvent + */ +- (void)logEvent:(MPEvent *)event; + +/** + Logs an event. This is a convenience method for logging simple events; internally it creates an instance of MPEvent + and calls logEvent: + @param eventName The name of the event to be logged (required not nil.) The string cannot be longer than 255 characters + @param eventType An enum value that indicates the type of event to be logged + @param eventInfo A dictionary containing further information about the event. This dictionary is limited to 100 key + value pairs. Keys must be strings (up to 255 characters) and values can be strings (up to 4096 characters), + numbers, booleans, or dates + @see logEvent: + */ +- (void)logEvent:(NSString *)eventName eventType:(MPEventType)eventType eventInfo:(nullable NSDictionary *)eventInfo; + +/** + Logs a screen event. You can define all the characteristics of a screen event (name, attributes, etc) in an + instance of MPEvent and pass that instance to this method to log its data to the mParticle SDK. + @param event An instance of MPEvent + @see MPEvent + */ +- (void)logScreenEvent:(MPEvent *)event; + +/** + Logs a screen event. This is a convenience method for logging simple screen events; internally it creates an instance + of MPEvent and calls logScreenEvent: + @param screenName The name of the screen to be logged (required not nil and up to 255 characters) + @param eventInfo A dictionary containing further information about the screen. This dictionary is limited to 100 key + value pairs. Keys must be strings (up to 255 characters) and values can be strings (up to 4096 characters), numbers, + booleans, or dates + @see logScreenEvent: + */ +- (void)logScreen:(NSString *)screenName eventInfo:(nullable NSDictionary *)eventInfo; + +#pragma mark - Attribution +/** + Convenience method for getting the most recently retrieved attribution info for all kits. + @returns A dictionary containing the most recent attribution info that was retrieved by each kit + @see MPKitInstance + */ +- (nullable NSDictionary *)attributionInfo; + +#pragma mark - Error, Exception, and Crash Handling +/** + Enables mParticle exception handling to automatically log events on uncaught exceptions. + */ +- (void)beginUncaughtExceptionLogging; + +/** + Disables mParticle automatic exception handling. + */ +- (void)endUncaughtExceptionLogging; + +/** + Leaves a breadcrumb. Breadcrumbs are send together with crash reports to help with debugging. + @param breadcrumbName The name of the breadcrumb (required not nil) + */ +- (void)leaveBreadcrumb:(NSString *)breadcrumbName; + +/** + Leaves a breadcrumb. Breadcrumbs are send together with crash reports to help with debugging. + @param breadcrumbName The name of the breadcrumb (required not nil) + @param eventInfo A dictionary containing further information about the breadcrumb + */ +- (void)leaveBreadcrumb:(NSString *)breadcrumbName eventInfo:(nullable NSDictionary *)eventInfo; + +/** + Logs an error with a message. + @param message The name of the error to be tracked (required not nil) + @see logError:eventInfo: + */ +- (void)logError:(NSString *)message; + +/** + Logs an error with a message and an attributes dictionary. The eventInfo is limited to + 100 key value pairs. The values in eventInfo cannot contain more than 4096 characters. + @param message The name of the error event (required not nil) + @param eventInfo A dictionary containing further information about the error + */ +- (void)logError:(NSString *)message eventInfo:(nullable NSDictionary *)eventInfo; + +/** + Logs an exception. + @param exception The exception which occurred + @see logException:topmostContext: + */ +- (void)logException:(NSException *)exception; + +/** + Logs an exception and a context. + @param exception The exception which occurred + @param topmostContext The topmost context of the app, typically the topmost view controller + */ +- (void)logException:(NSException *)exception topmostContext:(nullable id)topmostContext; + +#pragma mark - eCommerce Transactions +/** + Logs a commerce event. + @param commerceEvent An instance of MPCommerceEvent + @see MPCommerceEvent + */ +- (void)logCommerceEvent:(MPCommerceEvent *)commerceEvent; + +/** + Increases the LTV (LifeTime Value) amount of a user. + @param increaseAmount The amount to be added to LTV + @param eventName The name of the event (Optional). If not applicable, pass nil + */ +- (void)logLTVIncrease:(double)increaseAmount eventName:(NSString *)eventName; + +/** + Increases the LTV (LifeTime Value) amount of a user. + @param increaseAmount The amount to be added to LTV + @param eventName The name of the event (Optional). If not applicable, pass nil + @param eventInfo A dictionary containing further information about the LTV + */ +- (void)logLTVIncrease:(double)increaseAmount eventName:(NSString *)eventName eventInfo:(nullable NSDictionary *)eventInfo; + +#pragma mark - Extensions +/** + Registers an extension against the code mParticle SDK. Extensions are external code, unknown to the core SDK, which + conform to one of more known protocols. They allow the core SDK to function in ways beyond its core functionality. + @param extension An instance of a class conforming to a MPExtensionProtocol specialization + @see MPExtensionProtocol + */ ++ (BOOL)registerExtension:(id)extension; + +#pragma mark - Integration Attributes + +/** + * Set the integration attributes for a given integration ID. + * + * Integration attributes are keys and values specific to a given integration. For example, + * many integrations have their own internal user/device ID. mParticle will store integration attributes + * for a given device, and will be able to use these values for server-to-server communication to services. + * This is often useful when used in combination with a server-to-server feed, allowing the feed to be enriched + * with the necessary integration attributes to be properly forwarded to the given integration. + * + * Note: this action will be performed asynchronously. + * + * @param attributes a dictionary of attributes that will replace any current attributes. The keys are predefined by mParticle. + * Please consult with the mParticle docs or your solutions consultant for the correct value. You may + * also pass a null or empty map here to remove all of the attributes. + * @param integrationId mParticle integration ID. This may be the ID for a kit, or any mParticle integration. + * @see MPKitInstance + */ +- (MPKitExecStatus *)setIntegrationAttributes:(NSDictionary *)attributes forKit:(NSNumber *)integrationId; + +/** + * Clear the integration attributes for a given integration ID. + * + * Integration attributes are keys and values specific to a given integration. For example, + * many integrations have their own internal user/device ID. mParticle will store integration attributes + * for a given device, and will be able to use these values for server-to-server communication to services. + * This is often useful when used in combination with a server-to-server feed, allowing the feed to be enriched + * with the necessary integration attributes to be properly forwarded to the given integration. + * + * Note: this action will be performed asynchronously. + * + * @param integrationId mParticle integration ID. This may be the ID for a kit, or any mParticle integration. + * @see MPKitInstance + */ +- (MPKitExecStatus *)clearIntegrationAttributesForKit:(NSNumber *)integrationId; + +/** + * Get the integration attributes for a given integration ID. + * + * Integration attributes are keys and values specific to a given integration. For example, + * many integrations have their own internal user/device ID. mParticle will store integration attributes + * for a given device, and will be able to use these values for server-to-server communication to services. + * This is often useful when used in combination with a server-to-server feed, allowing the feed to be enriched + * with the necessary integration attributes to be properly forwarded to the given integration. + * + * Note: this will make a direct call to SQLite and should not be called on the main thread. + * + * @param integrationId mParticle integration ID. This may be the ID for a kit, or any mParticle integration. + * @see MPKitInstance + */ +- (nullable NSDictionary *)integrationAttributesForKit:(NSNumber *)integrationId; + +#pragma mark - Kits +/** + Allows you to schedule code to run after all kits have been initialized. If kits have already been initialized, + your block will be invoked immediately. If not, your block will be copied and the copy will be invoked once + kit initialization is finished. + @param block A block to be invoked once kits are initialized + */ +- (void)onKitsInitialized:(void(^)(void))block; + +/** + Returns whether a kit is active or not. You can retrieve if a kit has been already initialized and + can be used. + @param integrationId An NSNumber representing the kit to be checked + @returns Whether the kit is active or not. + */ +- (BOOL)isKitActive:(NSNumber *)integrationId; + +/** + Retrieves the internal instance of a kit, for cases where you need to use properties and methods of that kit directly. + + This method is only applicable to kits that allocate themselves as an object instance or as a singleton. For the cases + where kits are implemented with class methods, you can call those class methods directly + @param integrationId An NSNumber representing the kit to be retrieved + @returns The internal instance of the kit, or nil, if the kit is not active + @see MPKitInstance + */ +- (nullable id const)kitInstance:(NSNumber *)integrationId; + +/** + Asynchronously retrieves the internal instance of a kit, for cases where you need to use properties and methods of that kit directly. + + This method is only applicable to kits that allocate themselves as an object instance or as a singleton. For the cases + where kits are implemented with class methods, you can call those class methods directly + @param kitCode An NSNumber representing the kit to be retrieved + @param completionHandler A block to be called if or when the kit instance becomes available. If the kit never becomes + active, the block will never be called. If the kit is class based, the instance will be nil + @see MPKitInstance + */ +- (void)kitInstance:(NSNumber *)kitCode completionHandler:(void (^)(id _Nullable kitInstance))completionHandler; + +#pragma mark - Location +#if TARGET_OS_IOS == 1 +/** + Enables or disables the inclusion of location information to messages when your app is running on the + background. The default value is YES. Setting it to NO will cause the SDK to include location + information only when your app is running on the foreground. + @see beginLocationTracking:minDistance: + */ +@property (nonatomic, unsafe_unretained) BOOL backgroundLocationTracking; + +/** + Gets/Sets the current location of the active session. + @see beginLocationTracking:minDistance: + */ +@property (nonatomic, strong, nullable) CLLocation *location; + +/** + Begins geographic location tracking. + + The desired accuracy of the location is determined by a passed in constant for accuracy. + Choices are kCLLocationAccuracyBestForNavigation, kCLLocationAccuracyBest, + kCLLocationAccuracyNearestTenMeters, kCLLocationAccuracyHundredMeters, + kCLLocationAccuracyKilometer, and kCLLocationAccuracyThreeKilometers. + @param accuracy The desired accuracy + @param distanceFilter The minimum distance (measured in meters) a device must move before an update event is generated. + */ +- (void)beginLocationTracking:(CLLocationAccuracy)accuracy minDistance:(CLLocationDistance)distanceFilter; + +/** + Begins geographic location tracking. + + The desired accuracy of the location is determined by a passed in constant for accuracy. + Choices are kCLLocationAccuracyBestForNavigation, kCLLocationAccuracyBest, + kCLLocationAccuracyNearestTenMeters, kCLLocationAccuracyHundredMeters, + kCLLocationAccuracyKilometer, and kCLLocationAccuracyThreeKilometers. + @param accuracy The desired accuracy + @param distanceFilter The minimum distance (measured in meters) a device must move before an update event is generated. + @param authorizationRequest Type of authorization requested to use location services + */ +- (void)beginLocationTracking:(CLLocationAccuracy)accuracy minDistance:(CLLocationDistance)distanceFilter authorizationRequest:(MPLocationAuthorizationRequest)authorizationRequest; + +/** + Ends geographic location tracking. + */ +- (void)endLocationTracking; +#endif + +#pragma mark - Network Performance +/** + Allows you to log a network performance measurement independently from the mParticle SDK measurement. + @param urlString The absolute URL being measured + @param httpMethod The method used in the network communication (e.g. GET, POST, etc) + @param startTime The time when the network communication started measured in seconds since Unix Epoch Time: [[NSDate date] timeIntervalSince1970] + @param duration The number of seconds it took for the network communication took to complete + @param bytesSent The number of bytes sent + @param bytesReceived The number of bytes received + */ +- (void)logNetworkPerformance:(NSString *)urlString httpMethod:(NSString *)httpMethod startTime:(NSTimeInterval)startTime duration:(NSTimeInterval)duration bytesSent:(NSUInteger)bytesSent bytesReceived:(NSUInteger)bytesReceived; + +#pragma mark - Session management +/** + Increments the value of a session attribute by the provided amount. If the key does not + exist among the current session attributes, this method will add the key to the session attributes + and set the value to the provided amount. If the key already exists and the existing value is not + a number, the operation will abort. + + Note: this method has been changed to be async, return value will always be @0. + + @param key The attribute key + @param value The increment amount + @returns The static value @0 + */ +- (nullable NSNumber *)incrementSessionAttribute:(NSString *)key byValue:(NSNumber *)value; + +/** + Set a single session attribute. The property will be combined with any existing attributes. + There is a 100 count limit to existing session attributes. Passing in a nil value for an + existing key will remove the session attribute. + @param key The attribute key + @param value The attribute value + */ +- (void)setSessionAttribute:(NSString *)key value:(id)value; + +/** + Force uploads queued messages to mParticle. + */ +- (void)upload; + +#pragma mark - Surveys +/** + Returns the survey URL for a given provider. + @param surveyProvider The survey provider + @returns A string with the URL to the survey + @see MPSurveyProvider + */ +- (nullable NSString *)surveyURL:(MPSurveyProvider)surveyProvider; + + +#pragma mark - User Notifications +#if TARGET_OS_IOS == 1 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + Informs the mParticle SDK that the app has received a user notification while in the foreground. + @param center The notification center that received the notification + @param notification The notification that is about to be delivered + */ +- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification NS_AVAILABLE_IOS(10.0); + +/** + Informs the mParticle SDK that the user has interacted with a given notification + @param center The notification center that received the notification + @param response The user’s response to the notification + */ +- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response NS_AVAILABLE_IOS(10.0); +#endif + + +#pragma mark - Web Views +#if TARGET_OS_IOS == 1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +/** + Updates isIOS flag to true in JS API via given webview. + @param webView The web view to be initialized + */ +- (void)initializeWebView:(UIWebView *)webView; +#pragma clang diagnostic pop + +/** + Updates isIOS flag to true in JS API via given webview. + @param webView The web view to be initialized + */ +- (void)initializeWKWebView:(WKWebView *)webView; + +/** + Verifies if the url is mParticle sdk url i.e mp-sdk:// + @param requestUrl The request URL + */ +- (BOOL)isMParticleWebViewSdkUrl:(NSURL *)requestUrl; + +/** + Process log event from hybrid apps that are using iOS UIWebView or WKWebView control. + @param requestUrl The request URL + */ +- (void)processWebViewLogEvent:(NSURL *)requestUrl; + +#pragma mark - Manual Notification logging +/** + Logs a Notification event for a notification that has been reviewed but not acted upon. This is a convenience method for manually logging Notification events; Set trackNotifications to false on MParticleOptions to disable automatic tracking of Notifications and only set Notification manually: + */ +- (void)logNotificationReceivedWithUserInfo:(nonnull NSDictionary *)userInfo; + +/** + Logs a Notification event for a notification that has been reviewed and acted upon. This is a convenience method for manually logging Notification events; Set trackNotifications to false on MParticleOptions to disable automatic tracking of Notifications and only set Notification manually: + */ +- (void)logNotificationOpenedWithUserInfo:(nonnull NSDictionary *)userInfo; + +#endif + +@end + +NS_ASSUME_NONNULL_END diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Info.plist b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Info.plist new file mode 100644 index 0000000..db4ebe2 Binary files /dev/null and b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Info.plist differ diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Modules/module.modulemap b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Modules/module.modulemap new file mode 100644 index 0000000..c4abd88 --- /dev/null +++ b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module mParticle_Apple_SDK { + umbrella header "mParticle.h" + + export * + module * { export * } +} diff --git a/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/mParticle_Apple_SDK b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/mParticle_Apple_SDK new file mode 100755 index 0000000..11a5a9a Binary files /dev/null and b/Bindings/mParticle.Xamarin.iOSBinding/mParticle_Apple_SDK.framework/mParticle_Apple_SDK differ diff --git a/Library/mparticle.nuspec b/Library/mparticle.nuspec index 369ccc5..0a2a085 100644 --- a/Library/mparticle.nuspec +++ b/Library/mparticle.nuspec @@ -2,7 +2,7 @@ mParticle.Xamarin - 2.0.3 + 2.0.4 mParticle Xamarin SDK Wasi Haider, Sam Dozor, Will Passidomo, mParticle Inc. mParticle Inc.