Updated on 2026-08-14
This commit is contained in:
parent
d9092549aa
commit
78c4581372
2 changed files with 5 additions and 35 deletions
|
|
@ -34,18 +34,11 @@ class CustomerIoAnalyticsHandler(
|
||||||
class Builder : AnalyticsHandlerBuilder {
|
class Builder : AnalyticsHandlerBuilder {
|
||||||
override fun build(data: AnalyticsHandlerBuilder.Data): AnalyticsHandler? {
|
override fun build(data: AnalyticsHandlerBuilder.Data): AnalyticsHandler? {
|
||||||
val cdpApiKey = data.config.customerIoCdpApiKey
|
val cdpApiKey = data.config.customerIoCdpApiKey
|
||||||
return if (data.logConfig.isCustomerIoLogEnabled) {
|
if (cdpApiKey.isNullOrBlank()) return null
|
||||||
CustomerIoAnalyticsHandler(client = CustomerIoLogClient())
|
|
||||||
} else if (!cdpApiKey.isNullOrBlank()) {
|
return CustomerIoAnalyticsHandler(
|
||||||
CustomerIoAnalyticsHandler(
|
client = CustomerIoClient(application = data.application, cdpApiKey = cdpApiKey),
|
||||||
client = CustomerIoClient(
|
|
||||||
application = data.application,
|
|
||||||
cdpApiKey = cdpApiKey,
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue