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..aea3be2 100644 --- a/src/main/kotlin/com/mparticle/kits/CleverTapKit.kt +++ b/src/main/kotlin/com/mparticle/kits/CleverTapKit.kt @@ -47,16 +47,18 @@ 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) } + } }