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:
parent
cbf7edf8fa
commit
f97ee286cb
12 changed files with 293 additions and 13 deletions
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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))
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue