From a01d9092bafcac9c08f7d265f55a764fbce50028 Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Mon, 15 Sep 2025 15:38:49 +0900 Subject: [PATCH] docs(pr): summarize notification reliability changes (branch codex/fix-notification-reliability) --- doc/pr/codex-fix-notification-reliability.md | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/pr/codex-fix-notification-reliability.md diff --git a/doc/pr/codex-fix-notification-reliability.md b/doc/pr/codex-fix-notification-reliability.md new file mode 100644 index 0000000..4580f41 --- /dev/null +++ b/doc/pr/codex-fix-notification-reliability.md @@ -0,0 +1,43 @@ +Summary +- Improve local notification reliability on iOS and Android without adding dependencies. +- Keep diffs minimal: platform tweaks + small service/UI updates. + +Changes +- iOS + - ios/Runner/AppDelegate.swift + - Set UNUserNotificationCenter delegate on launch. + - Implement willPresent to show [.banner, .sound, .badge] while in foreground. +- Android + - android/app/src/main/AndroidManifest.xml + - Add RECEIVE_BOOT_COMPLETED for reboot rescheduling by plugin. + - Add SCHEDULE_EXACT_ALARM to allow exact timing on Android 12+. + - lib/services/notification_service.dart + - Create Android channels on init (subscription_channel, expiration_channel). + - Use AndroidScheduleMode.exactAllowWhileIdle for scheduled notifications. + - Ensure iOS DarwinNotificationDetails always present alert/sound/badge. + - Fix local variable overshadowing method parameter (title). + - Add canScheduleExactAlarms()/requestExactAlarmsPermission() wrappers. + - lib/screens/settings_screen.dart + - Add UI entry to request exact alarms permission when not granted (Android 12+). + +Validation +- Ran scripts/check.sh + - Formatting check: OK + - flutter analyze: No issues + - flutter test: All tests passed +- Manual assertions + - Foreground iOS notifications display banners/sounds. + - Android channels created proactively to avoid muted/low-importance. + +Risk & Rollback +- Risk + - Android 12+: Exact alarms require user approval in Settings > Special access > Alarms & reminders. + - Slight battery impact from exact alarms. +- Rollback + - Remove SCHEDULE_EXACT_ALARM and RECEIVE_BOOT_COMPLETED from AndroidManifest. + - Switch schedule mode back to AndroidScheduleMode.inexact in NotificationService. + +Notes +- No dependency changes. +- Reboot rescheduling relies on flutter_local_notifications standard behavior with RECEIVE_BOOT_COMPLETED. +