feat: 事件上报
This commit is contained in:
parent
8da97b5d04
commit
20b9dd5bfa
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue