From 29ecb7016e31ac75564afd79d5b8281c0e5eba56 Mon Sep 17 00:00:00 2001 From: Mansi-mParticle <159845845+Mansi-mParticle@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:32:55 -0400 Subject: [PATCH] feat: Update to Partner Latest version 7.0.2 (#100) --- build.gradle | 2 +- .../kotlin/com/mparticle/kits/CleverTapKit.kt | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 651b5b3..7c3f70a 100644 --- a/build.gradle +++ b/build.gradle @@ -42,5 +42,5 @@ android { dependencies { implementation 'androidx.legacy:legacy-support-v4:1.0.0' - api 'com.clevertap.android:clevertap-android-sdk:6.2.1' + api 'com.clevertap.android:clevertap-android-sdk:7.0.2' } diff --git a/src/main/kotlin/com/mparticle/kits/CleverTapKit.kt b/src/main/kotlin/com/mparticle/kits/CleverTapKit.kt index b3beb5f..daf7fb5 100644 --- a/src/main/kotlin/com/mparticle/kits/CleverTapKit.kt +++ b/src/main/kotlin/com/mparticle/kits/CleverTapKit.kt @@ -47,15 +47,16 @@ class CleverTapKit : KitIntegration(), UserAttributeListener, CommerceListener, */ private fun updateIntegrationAttributes() { cleverTapInstance?.let { - val cleverTapID = it.cleverTapAttributionIdentifier - if (!KitUtils.isEmpty(cleverTapID)) { - val integrationAttributes = HashMap(1) - integrationAttributes[CLEVERTAPID_INTEGRATION_KEY] = cleverTapID - } else { - if (handler == null) { - handler = Handler() + it.getCleverTapID { id -> + if (!KitUtils.isEmpty(id)) { + val integrationAttributes = HashMap(1) + integrationAttributes[CLEVERTAPID_INTEGRATION_KEY] = id + } else { + if (handler == null) { + handler = Handler() + } + handler?.postDelayed({ updateIntegrationAttributes() }, 500) } - handler?.postDelayed({ updateIntegrationAttributes() }, 500) } } }