TF-2877 Create ADR for notification setting decision

This commit is contained in:
DatDang
2024-06-04 14:08:49 +07:00
committed by Dat H. Pham
parent f477c5b697
commit 98c848db9a
2 changed files with 39 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# 48. Notification setting
Date: 2024-06-04
## Status
Accepted
## Context
- User need a way to tell and change notification configuration in-app
- However, no app is allowed directly change the device's settings by design
- With other third-party mails, app will redirect users to system settings if they desire to change it
## Decision
Twake Mail will follow the method of other third-party mails
## Consequences
The permission's status will always reflect system's configuration, and the system's configuration will be the single source of truth.
@@ -0,0 +1,20 @@
# 48. Notification setting
Date: 2024-06-07
## Status
Accepted
## Context
- User need a way to tell the notification configuration in-app
- Current method from `permission_handler` library is not enough to tell the exact permission status due to the fact that it does not support checking the specific notification group's status, which also affects the notification functionality alongside with the app's main toggle
## Decision
New method is written in Kotlin for Android side only, to handle this permission check more precisely
- For Android 28 or above, `getNotificationChannelGroup()` and its API `isBlocked` is supported to check if a specific notification group is disabled or not
- For Android lower than 28, a simple check by `areNotificationsEnabled()` is enough
## Consequences
The permission's status is better reflect on the Twake Mail app.