Skip to content

Commit

Permalink
fix: add custom attributes for comemrce events
Browse files Browse the repository at this point in the history
  • Loading branch information
alla-uday committed Nov 12, 2021
1 parent 65fba3b commit 6b267e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ else if (isPromotion) {
builder.shouldUploadEvent(map.getBoolean("shouldUploadEvent"));
}

if (map.has("customAttributes")) {
builder.customAttributes(ConvertStringMap(map.getJSONObject("customAttributes")));
}

return builder.build();
}

Expand Down
3 changes: 3 additions & 0 deletions plugin/src/ios/CDVMParticle.m
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ + (MPCommerceEvent *)MPCommerceEvent:(id)json {
if (json[@"shouldUploadEvent"] != nil) {
commerceEvent.shouldUploadEvent = [json[@"shouldUploadEvent"] boolValue];
}
if (json[@"customAttributes"] != nil) {
commerceEvent.customAttributes = json[@"customAttributes"];
}

NSMutableArray *products = [NSMutableArray array];
NSArray *jsonProducts = json[@"products"];
Expand Down

0 comments on commit 6b267e6

Please sign in to comment.