merged develop

This commit is contained in:
2026-09-27 14:58:07 +02:00
188 changed files with 7474 additions and 2558 deletions
@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../../api/marianumconnect/queries/telemetry_heartbeat/telemetry_heartbeat.dart';
import '../../../../push/push_registration.dart';
import '../../../../push/push_status.dart';
import '../../../../session/session_manager.dart';
@@ -104,6 +105,8 @@ class _PushSettingsState extends State<_PushSettings>
void _onToggle(bool enabled) {
widget.settings.val(write: true).notificationSettings.enabled = enabled;
// A permission granted below arrives via the resume heartbeat.
TelemetryHeartbeat.report(notificationsEnabled: enabled);
// Turning off does NOT unregister: the device stays subscribed so silent
// sync pushes keep arriving; the message handler and iOS NSE suppress only
// the visible notification (via the mirrored flag). Enabling (re-)registers
@@ -113,11 +116,10 @@ class _PushSettingsState extends State<_PushSettings>
final messenger = ScaffoldMessenger.of(context);
unawaited(() async {
try {
// Only register when the OS permission isn't explicitly denied —
// otherwise NC + proxy would push into the void.
if (await PushRegistration.requestOsPermission()) {
await PushRegistration().register();
} else {
final granted = await PushRegistration.requestOsPermission();
// Registered regardless: silent sync pushes need no permission.
await PushRegistration().register();
if (!granted) {
messenger.showSnackBar(
const SnackBar(
content: Text(