track method
Track an event. Routes automatically based on event.destination.
- all: To both EventBus and C++ telemetry (default)
- publicOnly: Only to EventBus (app developers can subscribe)
- analyticsOnly: Only to C++ telemetry (backend)
Implementation
void track(SDKEvent event) {
final destination = event.destination;
// Route to EventBus (public) - app developers subscribe here
if (destination == EventDestination.all ||
destination == EventDestination.publicOnly) {
_eventBus.publish(event);
}
// Route to C++ telemetry via DartBridge FFI
if (destination == EventDestination.all ||
destination == EventDestination.analyticsOnly) {
_trackToTelemetry(event);
}
}