Open tddang-linagora opened 6 months ago
please more detail on the technical guideline, how to prevent notification?
@hoangdat @dab246 Should we save the setting for each user and restore that setting when user login or whenever user is log out, this setting will be cleared?
@hoangdat @dab246 Should we save the setting for each user and restore that setting when user login or whenever user is log out, this setting will be cleared?
IMO, still a good choice to still save this settings event user logout. How about keychain item if we delete app in iOS?
How about keychain item if we delete app in iOS?
The user's data persists even after the app is deleted if we use Keychain
. If that's not what we want, changing the iOS's storage of choice from Keychain
to SharedPreferences
is better.
if we change to SharedPreference
how to prevent notification in NSE?
if we change to
SharedPreference
how to prevent notification in NSE?
Instead of from Keychain
, we will get the user's data from NSUserDefaults if SharedPreferences
is used. Either case, an entitlement has to be added to prevent notification in NSE. see this comment
IMO, we should use Hive
database, which is better stored as objects rather than as primitive variables in SharePreference
IMO, we should use
Hive
database, which is better stored as objects rather than as primitive variables in SharePreference
I only intend to store a boolean
so Hive
is a bit overkill.
IMO, we should use
Hive
database, which is better stored as objects rather than as primitive variables in SharePreferenceI only intend to store a
boolean
soHive
is a bit overkill.
So how does it support multiple accounts? How to manage it?
So how does it support multiple accounts? How to manage it?
Data is saved with SharedPreferences
using key-value
pair. The key
is where I intend to separate those values. E.g. The form of the key might take is "accountId
-mailboxRole
"
So how does it support multiple accounts? How to manage it?
Data is saved with
SharedPreferences
usingkey-value
pair. Thekey
is where I intend to separate those values. E.g. The form of the key might take is "accountId
-mailboxRole
"
When we want to turn on/off notifications for more mailboxes. We have to create multiple keys for each account then will now have a data table
accountId1-mailboxRole1 : value
accountId1-mailboxRole2 : value
accountId2-mailboxRole1 : value
accountId2-mailboxRole2 : value
accountId3-mailboxRole1 : value
accountId3-mailboxRole2 : value
It can be seen that organizing such data will be very confusing and will be difficult for future developers. IMO, we should organize in a tree style
account1: {
mailbox1 : value
mailbox2 : value
}
account2: {
mailbox1 : value
mailbox2 : value
}
we should organize in a tree style
Sure let me update the issue's description
Few points need to be mentioned
Inbox
idInbox
category if that mailbox's id is included with the emailOthers
category for every other emails@hoangdat @dab246 what do you think?
LGTM
@tddang-linagora can you try the JMAP requests to detect the email belongs to which mailbox?
Channel notification group - use System settings
Navigate to System settings from app
How to find it is Inbox
mailbox?
GetInboxMailboxIdInteractor
: accountId
- MailboxId
MailboxCacheManager
to check for Inbox
mailbox idMailbox/query
for role inbox
Inside _pushActionFromRemoteMessageBackground()
, call GetInboxMailboxIdInteractor.execute()
before the _mappingTypeStateToAction()
call inside FcmMessageController
. Add the Inbox
mailbox id to EmailChangeListener
.
Inside _showLocalNotification()
of EmailChangeListener
, add the Inbox
mailbox id to the local push notification config.
AppGroup
UserDefault
with Suite name = appGroupIdUserDefault
vs KeyChain
?
accountId|username|key
- Value: Dictionary {MailboxId: boolean} ADR-27
Description
Create a checkbox to control
Inbox
push notification. This checkbox will only appear if the toggle created in #2877 is on, and the checkbox's state will be cache withHive
for Android &Keychain
for iOS. When this checkbox is turned on, user will only receive push notification when new email comes toInbox
mailbox. When off, user will receive push notification for every new email from all mailboxes.Definitions of done
For Android
For iOS