TF-2871 Handle click notification to open detailed email on iOS

This commit is contained in:
dab246
2024-07-11 09:46:23 +07:00
committed by Dat H. Pham
parent 9ffd20f1a7
commit 501d4d38d9
32 changed files with 416 additions and 354 deletions
@@ -11,4 +11,8 @@ extension Date {
dateFormatter.locale = Locale(identifier: CoreUtils.EN_US_POSIX_LOCALE)
return dateFormatter.string(from: self)
}
func adding(seconds: Int) -> Date {
return self.addingTimeInterval(TimeInterval(seconds))
}
}
@@ -1,11 +0,0 @@
import Foundation
extension Int {
func convertMillisecondsToDate() -> Date {
return Date(timeIntervalSince1970: TimeInterval(self) / 1000)
}
func convertMillisecondsToISO8601String() -> String {
return convertMillisecondsToDate().convertDateToISO8601String()
}
}
@@ -41,9 +41,12 @@ class AuthenticationInterceptor: RequestInterceptor {
}
let newRefreshToken = tokenResponse.refreshToken ?? authenticationSSO.refreshToken
let expireTime = tokenResponse.expiresTime != nil
? tokenResponse.expiresTime!.convertMillisecondsToISO8601String()
: nil
var expireTime: String? = nil
if (tokenResponse.expiresTime != nil) {
expireTime = CoreUtils.shared.getCurrentDate().adding(seconds: tokenResponse.expiresTime!).convertDateToISO8601String()
}
self.authentication = AuthenticationSSO(
type: AuthenticationType.oidc,
+3
View File
@@ -5,6 +5,9 @@ class CoreUtils {
static let ISO8601_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"
static let EN_US_POSIX_LOCALE = "en_US_POSIX"
static let NOTIFICATION_INTERACTION_CHANNEL_NAME = "notification_interaction_channel"
static let CURRENT_EMAIL_ID_IN_NOTIFICATION_CLICK_WHEN_APP_FOREGROUND_OR_BACKGROUND = "current_email_id_in_notification_click_when_app_foreground_or_background"
static let CURRENT_EMAIL_ID_IN_NOTIFICATION_CLICK_WHEN_APP_TERMINATED = "current_email_id_in_notification_click_when_app_terminated"
func getCurrentDate() -> Date {
if #available(iOS 15, *) {