diff --git a/src/main/kotlin/com/mparticle/kits/AppboyKit.kt b/src/main/kotlin/com/mparticle/kits/AppboyKit.kt index 5e1e216..682cb48 100644 --- a/src/main/kotlin/com/mparticle/kits/AppboyKit.kt +++ b/src/main/kotlin/com/mparticle/kits/AppboyKit.kt @@ -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, diff --git a/src/test/kotlin/com/mparticle/kits/AppboyKitTest.kt b/src/test/kotlin/com/mparticle/kits/AppboyKitTest.kt index 0068304..9e4c994 100644 --- a/src/test/kotlin/com/mparticle/kits/AppboyKitTest.kt +++ b/src/test/kotlin/com/mparticle/kits/AppboyKitTest.kt @@ -449,6 +449,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() Assert.assertEquals(emptyAttributes, properties) }