-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analytics in common:core module #29
base: main
Are you sure you want to change the base?
Conversation
this.delegate = delegate | ||
} | ||
|
||
data class Event(val business: RawEvent?, val publish: RawEvent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
business
should not be nullable
} | ||
|
||
@ThreadLocal | ||
object Analytics { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to have all these properties and functions static. In Swift we consume events through a static method: Analytics.consume(event)
. Currently the generated interface requires to instantiate the Analytics
type and call methods from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please experiment to see what Kotlin code gives you the result you expect. Ping me if you'd like to brainstorm ideas together.
Those with access to Trafi's internal VPN can access & edit the event schema via the Mammoth editor.
Uses https://github.com/trafi/mammoth-kt to generate type-safe analytics events from the schema.
Any UI component can call
Analytics.consume(AnalyticsEvent.$eventName())
. By default, events go nowhere. Any SDK consumer can register anAnalyticsDelegate
to do something with the events.