Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Deleting property stripping from product when sent unbundled #86

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/mParticle-Appboy/MPKitAppboy.m
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ - (MPKitExecStatus *)routeCommerceEvent:(MPCommerceEvent *)commerceEvent {
}

// Strips key/values already being passed to Appboy, plus key/values initialized to default values
keys = @[kMPExpProductSKU, kMPProductCurrency, kMPExpProductUnitPrice, kMPExpProductQuantity, kMPProductAffiliation, kMPExpProductCategory, kMPExpProductName];
keys = @[kMPExpProductSKU, kMPProductCurrency, kMPExpProductUnitPrice, kMPExpProductQuantity];
[properties removeObjectsForKeys:keys];

[appboyInstance logPurchase:product.sku
Expand Down
5 changes: 4 additions & 1 deletion mParticle_AppboyTests/mParticle_AppboyTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ - (void)testlogPurchaseCommerceEvent {
XCTAssertEqualObjects(mockClient, [kit appboyInstance]);

MPProduct *product = [[MPProduct alloc] initWithName:@"product1" sku:@"1131331343" quantity:@1 price:@13];
product.category = @"category1";

MPCommerceEvent *event = [[MPCommerceEvent alloc] initWithAction:MPCommerceEventActionPurchase product:product];
event.customAttributes = @{@"testKey" : @"testCustomAttValue"};
Expand All @@ -430,7 +431,9 @@ - (void)testlogPurchaseCommerceEvent {
@"Total Amount" : @13.00,
@"Total Product Amount" : @"13",
@"Tax Amount" : @3,
@"Transaction Id" : @"foo-transaction-id"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add example of all 3 of the keys to this test? Everything else looks great!

@"Transaction Id" : @"foo-transaction-id",
@"Name" : @"product1",
@"Category" : @"category1"
}];

MPKitExecStatus *execStatus = [kit logBaseEvent:event];
Expand Down