Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-29 13:41:06 +03:00
parent d9092549aa
commit 78c4581372
2 changed files with 5 additions and 35 deletions

View file

@ -34,18 +34,11 @@ class CustomerIoAnalyticsHandler(
class Builder : AnalyticsHandlerBuilder {
override fun build(data: AnalyticsHandlerBuilder.Data): AnalyticsHandler? {
val cdpApiKey = data.config.customerIoCdpApiKey
return if (data.logConfig.isCustomerIoLogEnabled) {
CustomerIoAnalyticsHandler(client = CustomerIoLogClient())
} else if (!cdpApiKey.isNullOrBlank()) {
CustomerIoAnalyticsHandler(
client = CustomerIoClient(
application = data.application,
cdpApiKey = cdpApiKey,
),
)
} else {
null
}
if (cdpApiKey.isNullOrBlank()) return null
return CustomerIoAnalyticsHandler(
client = CustomerIoClient(application = data.application, cdpApiKey = cdpApiKey),
)
}
}
}

View file

@ -1,23 +0,0 @@
package com.tangem.tap.common.analytics.handlers.customerio
import com.tangem.utils.logging.TangemLogger
/**
* Log client for Customer.io (used in debug mode).
*
* Logs all operations to Timber instead of sending them to Customer.io.
*/
internal class CustomerIoLogClient : CustomerIoAnalyticsClient {
private var userId: String? = null
override fun setUserId(userId: String) {
this.userId = userId
TangemLogger.withTag(CustomerIoAnalyticsHandler.ID).d("identify: userId=$userId")
}
override fun clearUserId() {
TangemLogger.withTag(CustomerIoAnalyticsHandler.ID).d("clearIdentify: previous userId=$userId")
this.userId = null
}
}