recordSessionEvent method
- SessionEventKind kind,
- String occurredAt, {
- int? durationMs,
Append one session-lifecycle event (SessionEventKind.open /
.background / .close) to the local buffer for later
at-least-once delivery — does not itself hit the network.
durationMs is only meaningful for .close (foreground session
length); leave it null for .open/.background. It is clamped to
0…maxSessionDurationMs (a negative value records 0): the core stores
it as an unsigned 32-bit count of milliseconds.
Implementation
Future<void> recordSessionEvent(
SessionEventKind kind,
String occurredAt, {
int? durationMs,
}) =>
_platform.recordSessionEvent(
kind,
occurredAt,
durationMs: sessionDurationMs(durationMs),
);