- 目录/包名/类名/Gradle plugin 全部重命名 - XLog → BugCollect - logApiUrl/logEnabled → bugCollectApiUrl/bugCollectEnabled - assembleDebug 通过 Co-Authored-By: Claude <noreply@anthropic.com>
20 行
633 B
Kotlin
20 行
633 B
Kotlin
package com.xuqm.sdk.bugcollect
|
|
|
|
object FunnelTracker {
|
|
private val funnels = mutableMapOf<String, List<String>>()
|
|
private val progress = mutableMapOf<String, MutableList<String>>()
|
|
|
|
fun define(id: String, steps: List<String>) {
|
|
funnels[id] = steps
|
|
progress[id] = mutableListOf()
|
|
}
|
|
|
|
fun track(eventName: String, @Suppress("UNUSED_PARAMETER") properties: Map<String, Any?>) {
|
|
for ((id, steps) in funnels) {
|
|
val done = progress[id] ?: continue
|
|
val next = steps.getOrNull(done.size) ?: continue
|
|
if (next == eventName) done.add(eventName)
|
|
}
|
|
}
|
|
}
|