5061fcaced
Signed-off-by: dab246 <tdvu@linagora.com> (cherry picked from commit 121384a5b8af06e21d470962c31b0096feed455d)
1.3 KiB
1.3 KiB
17. Register firebase registration token guideline
Date: 2023-11-24
Status
Accepted
Context
The logic of firebase registration is complicated to follow by all developers
Decision
Brief the logic flows to easier in following the changes of firebase registration implementation
onFcmTokenChanged: Listen for token changes from FCM (Firebase Cloud Message)- If there is a new
token, we will send a request to the jmap server to check if this token has been registeredGetFirebaseRegistrationByDeviceIdInteractor.deviceClientIdis a unique key generated based ontokenandplatform - On the contrary, if no new token is generated, we will retrieve the
deviceClientIdstored incacheto call back the request to the above jmap server. - If the status after sending the request to the jmap server returns successful
GetFirebaseRegistrationByDeviceIdSuccesss. We perform a check to see ifFirebaseRegistrationTokenExpiredhas expired or not (The check is performed before3 days). If it expires, we will send a request to updateexpiresfor thisFirebaseRegistrationto increase the lifetime by7 more days. - Conversely, if we receive
GetFirebaseRegistrationByDeviceIdFailurewe will send a request to register a newFirebaseRegistration
Consequences
- Any change to
Push notifcationshould be updated in this ADR