Infrastructure medium complexity mobile
0
Dependencies
1
Dependents
0
Entities
0
Integrations

Description

Handles the OS-level calendar permission lifecycle on both iOS and Android, presenting a contextual in-app rationale screen before triggering the platform's native permission dialog. Follows platform guidelines for permission request timing - the rationale is shown only once before the first OS prompt, and the handler gracefully manages the denied/permanently-denied states without crashing the sync flow.

Feature: Calendar Sync

calendar-permission-handler

Sources & reasoning

Calendar access is a sensitive OS-level permission on both iOS and Android requiring a runtime grant. Platform guidelines mandate a contextual rationale before the system dialog to avoid one-shot rejections. This infrastructure component encapsulates the full permission lifecycle so CalendarSyncService never needs to know about platform-specific permission APIs.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Display an in-app rationale screen explaining why calendar access is needed before the OS dialog appears
  • Trigger the iOS and Android runtime permission request via the device_calendar plugin
  • Handle all permission states: granted, denied, permanently denied (Settings redirect)
  • Persist permission state locally to avoid re-prompting on every app launch
  • Expose a single permission gate used by CalendarSyncService before any write operation

Interfaces

requestCalendarPermission(): Future<CalendarPermissionStatus>
hasCalendarPermission(): Future<bool>
showPermissionRationale(context: BuildContext): Future<bool>
openAppSettings(): Future<void>

Relationships

Dependents (1)

Components that depend on this component