Skip to content

Commit

Permalink
Merge branch 'development' into feat/SQDS-5551_fix_sideloaded_integra…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
markvdouw authored Jul 20, 2023
2 parents 0a99f47 + 5395cbc commit d39422b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/kotlin/com/mparticle/kits/AppboyKit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ open class AppboyKit : KitIntegration(), AttributeListener, CommerceListener,
if (KitUtils.isEmpty(currencyValue)) {
currencyValue = CommerceEventUtils.Constants.DEFAULT_CURRENCY_CODE
}

event?.customAttributes?.let {
for ((key, value) in it) {
purchaseProperties.addProperty(key, value)
}
}

Braze.Companion.getInstance(context).logPurchase(
product.sku,
currencyValue,
Expand Down
5 changes: 5 additions & 0 deletions src/test/kotlin/com/mparticle/kits/AppboyKitTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ class AppboyKitTests {
properties.remove(CommerceEventUtils.Constants.ATT_AFFILIATION),
"the affiliation"
)

//Custom Attributes
Assert.assertEquals(properties.remove("key1"), "value1")
Assert.assertEquals(properties.remove("key #2"), "value #3")

val emptyAttributes = HashMap<String, String>()
Assert.assertEquals(emptyAttributes, properties)
}
Expand Down

0 comments on commit d39422b

Please sign in to comment.