Annotation based tracking handler
buildscript {
repositories {
maven { url 'https://jitpack.io' }
}
dependencies{
implementation 'com.github.alexxxdev:AnalyticsTracker:1.1.0'
kapt 'com.github.alexxxdev:AnalyticsTracker:1.1.0'
}
}
@Analytics
class AnyAnalytics : AnalyticsHandler {
override fun send(name: String, attrs: Map<String, Any?>) {
...
}
}
class Foo {
@AnalyticsAttr
val id:Int,
@AnalyticsAttr("name")
var name:String
...
}
val foo = Foo()
AnalyticsTracker.send("event name", foo)
or
AnalyticsTracker.send("event name")
AnalyticsTracker.send("event name", mapOf(...))