feat: 事件上报

This commit is contained in:
HuanCheng65 2023-07-23 21:11:09 +08:00
parent 8da97b5d04
commit 20b9dd5bfa
No known key found for this signature in database
GPG Key ID: 5EC9DD60A32C7360
1 changed files with 12 additions and 0 deletions

View File

@ -88,6 +88,7 @@ import com.huanchengfly.tieba.post.utils.newIntentFilter
import com.huanchengfly.tieba.post.utils.registerPickMediasLauncher
import com.huanchengfly.tieba.post.utils.requestIgnoreBatteryOptimizations
import com.huanchengfly.tieba.post.utils.requestPermission
import com.microsoft.appcenter.analytics.Analytics
import com.ramcosta.composedestinations.DestinationsNavHost
import com.ramcosta.composedestinations.animations.defaults.RootNavGraphDefaultAnimations
import com.ramcosta.composedestinations.animations.rememberAnimatedNavHostEngine
@ -333,6 +334,17 @@ class MainActivityV2 : BaseComposeActivity() {
navController.navigatorProvider += bottomSheetNavigator
val currentDestination by navController.currentDestinationAsState()
LaunchedEffect(currentDestination) {
val curDest = currentDestination
if (curDest != null) {
Analytics.trackEvent(
"PageChanged",
mapOf(
"page" to curDest.route,
)
)
}
}
CompositionLocalProvider(
LocalNavController provides navController,