mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-24 09:54:33 +01:00
Analytics Screen Link Fix
This commit is contained in:
parent
35a25bed84
commit
25ed7dd0b6
@ -30,6 +30,7 @@ import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory
|
||||
import com.shabinder.common.di.Dir
|
||||
import com.shabinder.common.di.DownloadProgressFlow
|
||||
import com.shabinder.common.di.FetchPlatformQueryResult
|
||||
import com.shabinder.common.di.firstLaunchDone
|
||||
import com.shabinder.common.di.initKoin
|
||||
import com.shabinder.common.di.isFirstLaunch
|
||||
import com.shabinder.common.di.isInternetAccessible
|
||||
@ -56,15 +57,15 @@ import javax.swing.JFileChooser.APPROVE_OPTION
|
||||
|
||||
private val koin = initKoin(enableNetworkLogs = true).koin
|
||||
private lateinit var showToast: (String)->Unit
|
||||
private lateinit var tracker: PiwikTracker
|
||||
private val tracker: PiwikTracker by lazy {
|
||||
PiwikTracker("https://kind-grasshopper-73.telebit.io/matomo/matomo.php")
|
||||
}
|
||||
|
||||
fun main() {
|
||||
|
||||
val lifecycle = LifecycleRegistry()
|
||||
lifecycle.resume()
|
||||
|
||||
tracker = PiwikTracker("https://kind-grasshopper-73.telebit.io/matomo/matomo.php")
|
||||
|
||||
Window("SpotiFlyer",size = IntSize(450,800)) {
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
@ -148,11 +149,15 @@ private fun spotiFlyerRoot(componentContext: ComponentContext): SpotiFlyerRoot =
|
||||
}
|
||||
override val analytics = object: SpotiFlyerRoot.Analytics {
|
||||
override fun appLaunchEvent() {
|
||||
// Enable Analytics
|
||||
directories.toggleAnalytics(true)
|
||||
if(directories.isFirstLaunch) {
|
||||
// Enable Analytics on First Launch
|
||||
directories.toggleAnalytics(true)
|
||||
directories.firstLaunchDone()
|
||||
}
|
||||
tracker.trackAsync {
|
||||
eventName = "App Launch"
|
||||
eventAction = "App_Launch"
|
||||
eventCategory = "events"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ fun PiwikTracker.trackScreenAsync(
|
||||
) {
|
||||
val req = PiwikRequest(
|
||||
1,
|
||||
URL("https://com.shabinder.spotiflyer/" + screenAddress.removeSurrounding("/"))
|
||||
URL("https://com.shabinder.spotiflyer$screenAddress")
|
||||
).apply { requestBuilder() }
|
||||
// Send Request
|
||||
sendRequestAsync(req)
|
||||
|
Loading…
Reference in New Issue
Block a user