Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Swap out fat library for latest iOS dylib
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Dozor committed Dec 19, 2018
1 parent 7ab7d18 commit b008399
Show file tree
Hide file tree
Showing 38 changed files with 2,980 additions and 50 deletions.
35 changes: 0 additions & 35 deletions Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions Bindings/mParticle.Xamarin.iOSBinding/NativeLibBuild/README.md

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
<ObjcBindingCoreSource Include="Structs.cs" />
</ItemGroup>
<ItemGroup>
<NativeReference Include="NativeLibBuild\libmParticle-Apple-SDK.a">
<Kind>Static</Kind>
<ForceLoad>True</ForceLoad>
<LinkerFlags>-lsqlite3 -lc++</LinkerFlags>
<NativeReference Include="mParticle_Apple_SDK.framework">
<Kind>Framework</Kind>
<SmartLink>False</SmartLink>
</NativeReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.ObjCBinding.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// FilteredMPIdentityApiRequest.h
//

#import <Foundation/Foundation.h>
#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<NSNumber *, NSString *> *userIdentities;

- (instancetype)initWithIdentityRequest:(MPIdentityApiRequest *)request kitConfiguration:(MPKitConfiguration *)kitConfiguration;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// FilteredMParticleUser.h
//

#import <Foundation/Foundation.h>
#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<NSNumber *, NSString *> *userIdentities;

/**
Gets all user attributes.
@returns A dictionary containing the collection of user attributes.
*/
@property (readonly, strong, nonnull) NSDictionary<NSString *, id> *userAttributes;

- (instancetype _Nonnull )initWithMParticleUser:(MParticleUser *_Nonnull)user kitConfiguration:(MPKitConfiguration *_Nonnull)kitConfiguration;

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

@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 <b>clear</b> method to empty its content and remove whatever data was persisted.
@see MPCommerce
@see mParticle
*/
@interface MPCart : NSObject <NSSecureCoding>

/**
Adds a product to the shopping cart.
Calling this method directly will create a <i>AddToCart</i> <b> MPCommerceEvent</b> with <i>product</i> and invoke the <b>logCommerceEvent:</b> method on your behalf.
<b>Swift</b>
<pre><code>
cart.addProduct(product)
</code></pre>
<b>Objective-C</b>
<pre><code>
[cart addProduct:product];
</code></pre>
@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.
<b>Swift</b>
<pre><code>
cart.addAllProducts(products, shouldLogEvents:false)
</code></pre>
<b>Objective-C</b>
<pre><code>
[cart addAllProducts:products shouldLogEvents:NO];
</code></pre>
@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<MPProduct *> *)products shouldLogEvents:(BOOL)shouldLogEvents;

/**
Empties the shopping cart. Removes all its contents and respective persisted data.
<b>Swift</b>
<pre><code>
cart.clear()
</code></pre>
<b>Objective-C</b>
<pre><code>
[cart clear];
</code></pre>
*/
- (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<MPProduct *> *)products;

/**
Removes a product from the shopping cart.
Calling this method directly will create a <i>RemoveFromCart</i> <b> MPCommerceEvent</b> with <i>product</i> and invoke the <b>logCommerceEvent:</b> method on your behalf.
<b>Swift</b>
<pre><code>
cart.removeProduct(product)
</code></pre>
<b>Objective-C</b>
<pre><code>
[cart removeProduct:product];
</code></pre>
@param product An instance of MPProduct
@see MPCommerceEvent
@see mParticle
*/
- (void)removeProduct:(nonnull MPProduct *)product;

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

@class MPCart;
@class MPTransactionAttributes;

/**
This class is a convenience wrapper to using the e-commerce methods.
It contains a reference to the cart singleton (<b>MPCart</b>), 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 <b>logCommerceEvent:</b> method.
<b>Usage:</b>
<b>Swift</b>
<pre><code>
let commerce = MParticle.sharedInstance().commerce
commerce.cart.addProduct(product)
commerce.purchaseWithTransactionAttributes(transactionAttributes, clearCart:true)
</code></pre>
<b>Objective-C</b>
<pre><code>
MPCommerce *commerce = [MParticle sharedInstance].commerce;
[commerce.cart addProduct:product];
[commerce purchaseWithTransactionAttributes:transactionAttributes clearCart:YES];
</code></pre>
@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 <i>clear</i> method.
*/
- (void)clearCart;

/**
Logs a <i>purchase</i> 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 <i>refund</i> 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
Original file line number Diff line number Diff line change
@@ -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<MPProduct *> *)products;
- (NSDictionary *)dictionaryRepresentation;
- (NSArray<MPCommerceEventInstruction *> *)expandedInstructions;
- (NSArray<MPProduct *> *const)addedProducts;
- (MPCommerceEventKind)kind;
- (void)removeProducts:(NSArray<MPProduct *> *)products;
- (NSArray<MPProduct *> *const)removedProducts;
- (void)resetLatestProducts;
- (MPEventType)type;
- (NSMutableDictionary *)beautifiedAttributes;
- (void)setBeautifiedAttributes:(NSMutableDictionary *)beautifiedAttributes;
- (NSMutableDictionary *)userDefinedAttributes;
- (void)setUserDefinedAttributes:(NSMutableDictionary *)userDefinedAttributes;
- (void)setImpressions:(NSDictionary<NSString *, __kindof NSSet<MPProduct *> *> *)impressions;
- (void)setProducts:(NSArray<MPProduct *> *)products;
- (NSMutableDictionary<NSString *, __kindof NSSet<MPProduct *> *> *)copyImpressionsMatchingHashedProperties:(NSDictionary *)hashedMap;
- (NSDate *)timestamp;
- (void)setTimestamp:(NSDate *)timestamp;

@end
Loading

0 comments on commit b008399

Please sign in to comment.