diff --git a/docs/adr/0045-memory-leak-with-js-lifecycle.md b/docs/adr/0045-memory-leak-with-js-lifecycle.md index 0ff354bd5..f90ad3eeb 100644 --- a/docs/adr/0045-memory-leak-with-js-lifecycle.md +++ b/docs/adr/0045-memory-leak-with-js-lifecycle.md @@ -1,4 +1,4 @@ -# 44. Memory leak with js lifecycle +# 45. Memory leak with js lifecycle Date: 2024-04-09 diff --git a/docs/adr/0046-enable-silent-for-notification-in-device-android-when-use-flutter-local-notification-library.md b/docs/adr/0046-enable-silent-for-notification-in-device-android-when-use-flutter-local-notification-library.md new file mode 100644 index 000000000..432cfcefe --- /dev/null +++ b/docs/adr/0046-enable-silent-for-notification-in-device-android-when-use-flutter-local-notification-library.md @@ -0,0 +1,26 @@ +# 46. Enable `silent` for notification in device android when use flutter_local_notification library + +Date: 2024-05-10 + +## Status + +- Issue: + - [Notification flood](https://github.com/linagora/tmail-flutter/issues/2599) + +## Context + +- According to the official documentation of [flutter_local_notification](https://pub.dev/packages/flutter_local_notifications#-android-setup). +For Android 8.0+, sounds and vibrations are associated with notification channels and can only be configured when they are first created. +And it cannot be changed unless creating a new channel or reinstalling the application. +- So how can we only turn on the sound and vibration of one notification and turn it off for the remaining notifications when we display them at the same time? +- From version [v16.2.0](https://pub.dev/packages/flutter_local_notifications/changelog#1620) of flutter_local_notifications added the `silent` property to the `AndroidNotificationDetails` that allows specifying a notification on Android to be silent even if associated the notification channel allows for sounds to be played. + +## Decision + +- Set + - `silent=true` for all notifications with id `EmailId` + - `silent=false` for notifications with id `GroupdId`. + +## Consequences + +- There is only one notification with sound and vibration in the received notification list at the same time.