Skip to content

Commit d3f6394

Browse files
authored
fix: add custom attributes for ecommerce events (#58)
1 parent f388c1d commit d3f6394

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

android/src/main/java/com/mparticle/react/MParticleModule.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,9 @@ else if (isPromotion) {
595595
if (map.hasKey("shouldUploadEvent")) {
596596
builder.shouldUploadEvent(map.getBoolean("shouldUploadEvent"));
597597
}
598+
if (map.hasKey("customAttributes")) {
599+
builder.customAttributes(ConvertStringMap(map.getMap("customAttributes")));
600+
}
598601

599602
return builder.build();
600603
}

ios/RNMParticle/RNMParticle.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ + (MPCommerceEvent *)MPCommerceEvent:(id)json {
419419
if (json[@"shouldUploadEvent"] != nil) {
420420
commerceEvent.shouldUploadEvent = [json[@"shouldUploadEvent"] boolValue];
421421
}
422+
if (json[@"customAttributes"] != nil) {
423+
commerceEvent.customAttributes = json[@"customAttributes"];
424+
}
422425

423426
NSMutableArray *products = [NSMutableArray array];
424427
NSArray *jsonProducts = json[@"products"];

0 commit comments

Comments
 (0)