Sync Scheduled Activities and Events to Device Native Calendar
The Calendar Sync Service integrates with the device's native calendar using the device_calendar Flutter plugin. On first use, the service requests calendar read/write permissions using the standard iOS and Android permission flows, explaining clearly why the permission is needed. Once granted, creating or updating an activity or event in the app offers an optional 'Add to Calendar' action. When accepted, the service writes a calendar entry with the activity title, date, time, duration, location (if available), and a brief description. If an activity is edited or deleted, the corresponding calendar entry is updated or removed accordingly. Calendar permission denial is handled gracefully, showing a contextual explanation without blocking other app functionality.
User Story
Acceptance Criteria
- Given a user has not previously granted calendar permissions, when they first trigger a calendar sync action, then the OS permission dialog is shown with a clear rationale message
- Given calendar permission is granted, when a user creates an activity or event and chooses to add it to their calendar, then a calendar entry is created in the device's default calendar with correct title, date, time, and duration
- Given a user edits a previously synced activity (e.g., changes the date), when the edit is saved, then the corresponding calendar entry is updated to reflect the new details
- Given a user deletes a synced activity, when the deletion is confirmed, then the corresponding calendar entry is removed from the device calendar
- Given a user denies calendar permission, when they attempt to use calendar sync, then a non-blocking banner explains how to enable the permission in device settings, and all other app functionality continues normally
Business Value
Calendar synchronization transforms the app from a passive logging tool into an active scheduling companion. For peer mentors juggling volunteer commitments alongside personal schedules, seeing peer support sessions in their native calendar prevents no-shows and double bookings. HLF specifically identified calendar sync as a mechanism to reduce missed engagements and improve follow-through on commitments. The native calendar integration also means peer mentors receive OS-level reminders for activities, providing an additional engagement touchpoint without requiring a separate in-app reminder system.
Components
- Calendar Sync Service service
- Notification Repository data