1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2450 Membership | Analytics (#1284)

This commit is contained in:
Konstantin Ivanov 2024-06-11 12:30:49 +02:00 committed by konstantiniiv
parent cbf7edf8fa
commit f97ee286cb
12 changed files with 293 additions and 13 deletions

View file

@ -3,8 +3,19 @@ package com.anytypeio.anytype.analytics.props
sealed class UserProperty {
data class AccountId(val id: String?) : UserProperty()
data class InterfaceLanguage(val lang: String) : UserProperty()
data class Tier(val tierId: Int) : UserProperty() {
val tier: String
get() = when (tierId) {
0 -> "None"
1 -> "Explorer"
4 -> "Builder"
5 -> "Co-Creator"
else -> "Custom"
}
}
companion object {
const val INTERFACE_LANG_KEY = "interfaceLang"
const val TIER_KEY = "tier"
}
}

View file

@ -63,6 +63,11 @@ class AmplitudeTracker(
JSONObject(mapOf(UserProperty.INTERFACE_LANG_KEY to prop.lang))
)
}
is UserProperty.Tier -> {
tracker.setUserProperties(
JSONObject(mapOf(UserProperty.TIER_KEY to prop.tier))
)
}
}
}
}