analyticsContext method

Map<String, Object?> analyticsContext()

Session/install/foreground-duration context meant to be attached to an analytics event — returns {} unless analytics consent is currently granted (no registered ConsentStateService counts as not granted).

Implementation

Map<String, Object?> analyticsContext() =>
    (ConsentStateService.maybe?.isGranted(ConsentCategory.analytics) ?? false)
    ? _rawAnalyticsContext()
    : const {};