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.Dir
|
||||||
import com.shabinder.common.di.DownloadProgressFlow
|
import com.shabinder.common.di.DownloadProgressFlow
|
||||||
import com.shabinder.common.di.FetchPlatformQueryResult
|
import com.shabinder.common.di.FetchPlatformQueryResult
|
||||||
|
import com.shabinder.common.di.firstLaunchDone
|
||||||
import com.shabinder.common.di.initKoin
|
import com.shabinder.common.di.initKoin
|
||||||
import com.shabinder.common.di.isFirstLaunch
|
import com.shabinder.common.di.isFirstLaunch
|
||||||
import com.shabinder.common.di.isInternetAccessible
|
import com.shabinder.common.di.isInternetAccessible
|
||||||
@ -56,15 +57,15 @@ import javax.swing.JFileChooser.APPROVE_OPTION
|
|||||||
|
|
||||||
private val koin = initKoin(enableNetworkLogs = true).koin
|
private val koin = initKoin(enableNetworkLogs = true).koin
|
||||||
private lateinit var showToast: (String)->Unit
|
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() {
|
fun main() {
|
||||||
|
|
||||||
val lifecycle = LifecycleRegistry()
|
val lifecycle = LifecycleRegistry()
|
||||||
lifecycle.resume()
|
lifecycle.resume()
|
||||||
|
|
||||||
tracker = PiwikTracker("https://kind-grasshopper-73.telebit.io/matomo/matomo.php")
|
|
||||||
|
|
||||||
Window("SpotiFlyer",size = IntSize(450,800)) {
|
Window("SpotiFlyer",size = IntSize(450,800)) {
|
||||||
Surface(
|
Surface(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
@ -148,11 +149,15 @@ private fun spotiFlyerRoot(componentContext: ComponentContext): SpotiFlyerRoot =
|
|||||||
}
|
}
|
||||||
override val analytics = object: SpotiFlyerRoot.Analytics {
|
override val analytics = object: SpotiFlyerRoot.Analytics {
|
||||||
override fun appLaunchEvent() {
|
override fun appLaunchEvent() {
|
||||||
// Enable Analytics
|
if(directories.isFirstLaunch) {
|
||||||
directories.toggleAnalytics(true)
|
// Enable Analytics on First Launch
|
||||||
|
directories.toggleAnalytics(true)
|
||||||
|
directories.firstLaunchDone()
|
||||||
|
}
|
||||||
tracker.trackAsync {
|
tracker.trackAsync {
|
||||||
eventName = "App Launch"
|
eventName = "App Launch"
|
||||||
eventAction = "App_Launch"
|
eventAction = "App_Launch"
|
||||||
|
eventCategory = "events"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ fun PiwikTracker.trackScreenAsync(
|
|||||||
) {
|
) {
|
||||||
val req = PiwikRequest(
|
val req = PiwikRequest(
|
||||||
1,
|
1,
|
||||||
URL("https://com.shabinder.spotiflyer/" + screenAddress.removeSurrounding("/"))
|
URL("https://com.shabinder.spotiflyer$screenAddress")
|
||||||
).apply { requestBuilder() }
|
).apply { requestBuilder() }
|
||||||
// Send Request
|
// Send Request
|
||||||
sendRequestAsync(req)
|
sendRequestAsync(req)
|
||||||
|
Loading…
Reference in New Issue
Block a user