[Feature Request]: Implement local push notifications for upcoming contest reminders
- Dominant language
- Swift
- Stars
- 0
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### Description:
Users currently have no way to be reminded about upcoming Codeforces contests. They have to manually check the app or the Codeforces website. The app should allow users to set local notification reminders for contests they're interested in, so they never miss a contest start.
### Current Behavior:
- The `ContestDetailView` shows a "Starts in" countdown, but this only works while the app is open.
- `EventKit` and `EventKitUI` are imported in `ContestListView.swift` but **never used** — there is no calendar or notification integration.
- Once the user closes the app, there is no way to be reminded about a contest.
### Feature Requirements:
**Notification Scheduling:**
- Add a "Remind Me" button on the `ContestDetailView`.
- When tapped, schedule a local notification using `UNUserNotificationCenter` that fires **30 minutes before** the contest starts.
- The notification should display: contest name, start time, and a "Rated/Unrated" indicator.
- If the contest is less than 30 minutes away, schedule the notification for 5 minutes before instead.
**Permission Handling:**
- Request notification permission (`UNUserNotificationCenter.requestAuthorization`) on first use, not at app launch.
- If permission is denied, show a settings redirect prompt explaining why notifications are useful.
**Reminder Management:**
- Toggle the "Remind Me" button state — tapping again should cancel the scheduled notification.
- Visually indicate which contests have reminders set (e.g., a filled bell icon vs. an outlined one).
- Store reminder state using `UserDefaults` or `@AppStorage` keyed by contest ID.
**Edge Cases:**
- Don't allow reminders for contests that have already started.
- Clean up expired notification requests for contests that have already passed.
### Key Files:
| Action | File |
|--------|------|
| **CREATE** | `CForge/Services/NotificationManager.swift` |
| **MODIFY** | `CForge/Views/Contest/ContestListView.swift` (ContestDetailView section) |
| **MODIFY** | `CForge/Views/Contest/ContestModels.swift` (optional: add reminder state) |
### Expected Outcome:
- Users can tap "Remind Me" on any upcoming contest and receive a local notification 30 minutes before it starts.
- Notification permission is requested gracefully on first use.
- Reminder state is persisted and visually reflected in the UI (bell icon toggle).
- Already-started contests cannot have reminders set.
- The "Remind Me" button uses the app's neon theme styling.
Contributor guide
Assessment
This issue has not been assessed yet.