-
Notifications
You must be signed in to change notification settings - Fork 1
Log your analytics
Mohamed Hamdan edited this page Nov 6, 2018
·
1 revision
With @Analytics annotation you be able to log your events by annotate your fields with this annotation and add one or more events to same field.
@Analytics(Event("Login"))
val age: Int
For support multiple events on same field you may add multiple @Event
to same @Analytics
@Analytics(
Event("Login"),
Event("Register"),
Event("Logout")
)
val age: Int
data class User(
@Analytics(
Event("Login"),
Event("Logout")
)
val name: String,
@Analytics(Event("Logout"))
val email: String,
@Analytics(Event("Login"))
val phone: String,
@Analytics(
Event("Login"),
Event("Logout")
)
val age: Int,
@AnalyticsEmbedded
val address: Address?
)
Now you able to use analytics like this
Analytics.getInstance(context).userAnalytics.loginEvent(User())
No reflection here, all code is auto generated