From 80d66f252ec14aeae394dbce224c383bab9a915f Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 12 Jan 2026 19:57:31 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../appsflyer/AppsFlyerAnalyticsClient.kt | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/common/analytics/handlers/appsflyer/AppsFlyerAnalyticsClient.kt b/app/src/main/java/com/tangem/tap/common/analytics/handlers/appsflyer/AppsFlyerAnalyticsClient.kt index 7fab19081f..4638a88856 100644 --- a/app/src/main/java/com/tangem/tap/common/analytics/handlers/appsflyer/AppsFlyerAnalyticsClient.kt +++ b/app/src/main/java/com/tangem/tap/common/analytics/handlers/appsflyer/AppsFlyerAnalyticsClient.kt @@ -1,6 +1,7 @@ package com.tangem.tap.common.analytics.handlers.appsflyer import android.content.Context +import com.appsflyer.AppsFlyerConversionListener import com.appsflyer.AppsFlyerLib import com.appsflyer.attribution.AppsFlyerRequestListener import com.tangem.core.analytics.api.EventLogger @@ -17,18 +18,39 @@ internal class AppsFlyerClient( private val appsFlyerLib: AppsFlyerLib = AppsFlyerLib.getInstance() private val eventConverter = UnderscoreAnalyticsEventConverter() + private val logEventListener = object : AppsFlyerRequestListener { + override fun onSuccess() { + Timber.tag("AppsFlyerClient").i("AppsFlyerRequestListener send") + } + + override fun onError(p0: Int, p1: String) { + Timber.tag("AppsFlyerClient").e("AppsFlyerRequestListener onError: $p0, $p1") + } + } init { - appsFlyerLib.init(key, null, context) - appsFlyerLib.start(context, key, object : AppsFlyerRequestListener { - override fun onSuccess() { - Timber.d("AppsFlyer initialized successfully") - } + val conversionListener = object : AppsFlyerConversionListener { + override fun onConversionDataSuccess(p0: Map?) {} + override fun onConversionDataFail(p0: String?) {} + override fun onAppOpenAttribution(p0: Map?) {} + override fun onAttributionFailure(p0: String?) {} + } - override fun onError(p0: Int, p1: String) { - Timber.e("AppsFlyer initialization error: $p0, $p1") - } - }) + appsFlyerLib.run { + setAppId(context.packageName) + setDebugLog(true) + + init(key, conversionListener, context) + start(context, key, object : AppsFlyerRequestListener { + override fun onSuccess() { + Timber.i("AppsFlyer initialized successfully") + } + + override fun onError(p0: Int, p1: String) { + Timber.e("AppsFlyer initialization error: $p0, $p1") + } + }) + } } override fun setUserId(userId: String) { @@ -44,6 +66,7 @@ internal class AppsFlyerClient( context, event, eventConverter.convertEventParams(params), + logEventListener, ) } } \ No newline at end of file