added telemetry call on app resume with 15 minute cooldown

This commit is contained in:
2026-07-28 12:52:07 +02:00
parent 7e9cbcf1e9
commit 778c473631
2 changed files with 27 additions and 7 deletions
@@ -12,8 +12,9 @@ import 'telemetry_device_id.dart';
/// Sends a telemetry heartbeat to MarianumConnect (`POST me/telemetry`) —
/// upserts the stable install id, platform, app version and device info. Sent
/// once on app start and again once push registration completes that session
/// (so a fresh registration isn't under-reported until the next launch).
/// on app start, again once push registration completes that session (so a
/// fresh registration isn't under-reported until the next launch), and on
/// resume after the app spent more than 15 minutes in the background.
/// Bearer-authenticated via the shared dio interceptor. Replaces the legacy
/// mhsl.eu `server/userIndex/update` call.
class TelemetryHeartbeat extends MarianumConnectQuery {
@@ -21,7 +22,8 @@ class TelemetryHeartbeat extends MarianumConnectQuery {
/// Fire-and-forget: schedules a heartbeat and swallows any error, so a failed
/// send never disrupts app start. Used from the app shell's initState and
/// re-emitted once push registration completes (see `_MainState._syncPush`).
/// lifecycle handler, and re-emitted once push registration completes (see
/// `_MainState._syncPush`).
static void report({required bool notificationsEnabled}) {
unawaited(
TelemetryHeartbeat()