Notification Permission Manager
Component Detail
Description
Manages iOS and Android system-level notification permission requests and status checks. Shows a contextual rationale dialog before the system prompt on first request. Provides reactive permission state stream consumed by the settings screen.
notification-permission-manager
Summaries
The Notification Permission Manager governs the critical first moment when the application requests permission to send users push notifications — a one-time opportunity that directly determines whether the platform can maintain ongoing communication with each user. By presenting a contextual rationale dialog before the system prompt, the component significantly increases permission grant rates compared to presenting the raw system dialog without context. Higher permission rates translate directly into larger reachable audiences for time-sensitive communications such as deadline warnings and assignment alerts, improving program coordination outcomes. Handling the permanently-denied case with a settings redirect also recovers users who initially declined, preserving long-term communication capability.
This is a low-complexity mobile component with no external service dependencies, making it a safe early delivery item. However, it is a blocking dependency for any end-to-end notification flow testing — without granted permission, FCM tokens cannot be registered and no notifications will be received on device.
Plan to deliver this component early in the sprint so that the rest of the notification feature can be tested on real devices. The rationale dialog copy must be reviewed by the product team before implementation, as the wording directly impacts permission grant rates. iOS requires specific Xcode entitlement configuration for push notifications, which should be verified during project setup rather than discovered during QA.
Implemented using the permission_handler Flutter package (or firebase_messaging's own `requestPermission()` on iOS), this component wraps platform-specific permission APIs behind a unified interface. `requestPermission()` first shows an application-level rationale AlertDialog; on confirmation, it calls the underlying platform permission request. `checkPermissionStatus()` returns a PermissionStatus enum value synchronously from cached state or via an async platform call. `permissionStatusStream()` exposes a Stream
`openSystemSettings()` calls `openAppSettings()` from permission_handler for the permanently-denied recovery flow. `isGranted()` is a convenience synchronous bool accessor. Keep this component stateless at the BLoC level; let the stream carry all reactive state.
Responsibilities
- Request system notification permission with pre-prompt rationale dialog
- Check and expose current permission status as a stream
- Open system settings if permission was permanently denied
Interfaces
requestPermission()
checkPermissionStatus()
permissionStatusStream()
openSystemSettings()
isGranted()
Relationships
Used Integrations (1)
External integrations and APIs this component relies on