CalendarSyncService
Component Detail
Service Layer
medium complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Manages bidirectional synchronisation between the app and the user's device calendar (iOS Calendar / Google Calendar). It pushes confirmed activity events to the device calendar and polls for incoming calendar events that match known activity types, converting them into pre-filled activity drafts. Sync runs in the background while the app is active and respects the user's permission state at all times.
calendar-sync-service
Sources & reasoning
HLF explicitly named calendar synchronization alongside push notifications as part of their follow-up improvement plan (line 116). The phase matrix places this in Fase 2 (v1.0) alongside push and BankID, consistent with the "should have" classification.
-
docs/source/likeperson.md · line 116Oppfølging av likepersoner: 40 % var ikke fornøyd med oppfølgingen i spørreundersøkelse. Scenariobaserte push-meldinger og kalendersynkronisering.
Responsibilities
- Push confirmed app activities to the device calendar as calendar events
- Poll device calendar for events matching activity types and convert them to draft activities
- Run background sync cycles while the app is in the foreground
- Deduplicate events to prevent double-entry across repeated sync cycles
- Coordinate with CalendarPermissionHandler before any calendar read/write operation
Interfaces
syncToDeviceCalendar(activityId: string): Promise<CalendarEventId>
importFromDeviceCalendar(dateRange: DateRange): Promise<ActivityDraft[]>
runBackgroundSync(): Promise<SyncResult>
cancelSync(): void