DartBridgeTelemetry class
Telemetry bridge for C++ telemetry operations.
Matches Swift's CppBridge+Telemetry.swift.
C++ handles all telemetry logic:
- Convert analytics events to telemetry payloads
- Queue and batch events
- Group by modality for production
- Serialize to JSON (environment-aware)
- Callback to Dart for HTTP calls
Dart provides:
- Device info
- HTTP transport for sending telemetry
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → DartBridgeTelemetry
-
final
Static Methods
-
attachSinkPhase1(
{required SDKEnvironment environment, required String deviceId}) → void - Create the telemetry manager and attach it as the C++ event router's telemetry sink, in Phase 1 — BEFORE commons emits the INITIALIZATION_STAGE_STARTED/COMPLETED events from rac_sdk_init_phase1_proto. Without this the "system" modality never lands: those init events fire during Phase-1 core init, and if the sink is only attached in Phase 2 they hit a null sink and are dropped. The manager queues events immediately; the actual flush still waits for Phase 2 (HTTP layer configured). Device info (async model lookup) is filled in later by initialize.
-
drainHttpQueue(
) → void -
Drain commons' queued telemetry HTTP requests (signalled by the wake-up).
Each request is an owned buffer framed as
u32 LE endpointLenjson. -
flush(
) → void - Flush any queued telemetry events. Static method that delegates to instance if initialized. Matches Swift: CppBridge.Telemetry.flush()
-
initialize(
{required SDKEnvironment environment, required String deviceId, String? baseURL}) → Future< void> - Complete telemetry init (Phase 2): fill in device info. Reuses the manager created in Phase 1 via attachSinkPhase1; only creates one here as a fallback (gated on a real baseURL) if Phase-1 attach never ran.
-
initializeSync(
{required SDKEnvironment environment}) → void - Synchronous initialization - just stores environment. Matches Swift's Telemetry.initialize() in Phase 1 (minimal setup). Full initialization with device info happens in Phase 2 via initialize().
-
shutdown(
) → Future< void> - Shutdown telemetry manager