mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
After a cold restart the app considered push enabled (from prefs) but never re-registered its FCM token, so a rotated token (or a backend that lost its token store) left the backend delivering to nothing while the test button still reported success. Re-register the current token at launch so the backend converges to the live token on every start, and re-attach the foreground display handler then too (it was previously only wired during enable()). Also tidy push_service.dart: a single initPushOnLaunch() startup entry point so main.dart needs no push internals, one owner for the persisted push-enabled flag (pushEnabledOnThisDevice / setPushEnabledOnThisDevice) instead of a hard-coded key in four places, private internal helpers, deduped platform checks, and section grouping. enable() now reuses the shared token-registration path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>