Skip to content

Instantly share code, notes, and snippets.

@ryancfogarty
Created September 4, 2025 14:11
Show Gist options
  • Select an option

  • Save ryancfogarty/c03acd286c69829f8fc7e90979de57d9 to your computer and use it in GitHub Desktop.

Select an option

Save ryancfogarty/c03acd286c69829f8fc7e90979de57d9 to your computer and use it in GitHub Desktop.
AndroidAnalytics Init
single<CoreAnalytics> {
AndroidAnalytics(
writeKey = AnalyticsBuildKonfig.segmentKey,
context = get()
) {
trackApplicationLifecycleEvents = true
collectDeviceId = true
flushInterval = 10
defaultSettings = run {
val settings = <redacted code which decodes settings from secret json key>
settings
}
errorHandler = {
logError("Segment error", it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment