TF-2871 Handle click notification to open detailed email on iOS
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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, *) {
|
||||
|
||||
Reference in New Issue
Block a user