diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift
index 08117bb6..56cd8af4 100644
--- a/GMERemittance/AppDelegate.swift
+++ b/GMERemittance/AppDelegate.swift
@@ -56,6 +56,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
setupNavBar()
setEntryPoint()
+ UserDefaults.standard.removeObject(forKey: AppConstants.isOpenedTokenRenwalAlert)
+ UserDefaults.standard.removeObject(forKey: AppConstants.isOpenedPopupNotification)
return true
}
diff --git a/GMERemittance/Info.plist b/GMERemittance/Info.plist
index cf5a8b7d..9db2aeb5 100644
--- a/GMERemittance/Info.plist
+++ b/GMERemittance/Info.plist
@@ -30,7 +30,7 @@
CFBundleVersion
- 1
+ 2
Fabric
APIKey
diff --git a/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift b/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift
index 6d09eaa2..95777079 100644
--- a/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift
+++ b/GMERemittance/Module/Home/User Interface/View/HomeViewController.swift
@@ -83,8 +83,6 @@ class HomeViewController: UIViewController, UICollectionViewDelegateFlowLayout {
var userHotLine: HotLine?
- var isShowTokenRenewAlert = false
-
override func viewDidLoad() {
super.viewDidLoad()
// test()
@@ -772,7 +770,7 @@ extension HomeViewController {
}
private func checkKFTCToken() {
- if !isShowTokenRenewAlert {
+ if !UserDefaults.standard.bool(forKey: AppConstants.isOpenedTokenRenwalAlert) {
// TODO: Show Alert for token refresh (navigation push)
guard
let remind = UserDefaults.standard.string(forKey: UserKeys.remindKFTCTokenDay),
@@ -793,11 +791,11 @@ extension HomeViewController {
cancelTitle: "later_text".localized(),
okAction: {
AutoDebitWireframe().pushMainView(on: self)
- self.isShowTokenRenewAlert = true
+ UserDefaults.standard.set(true, forKey: AppConstants.isOpenedTokenRenwalAlert)
},
cancelAction : {
- self.isShowTokenRenewAlert = true
self.popUpNotification()
+ UserDefaults.standard.set(true, forKey: AppConstants.isOpenedTokenRenwalAlert)
}
)
} else {
@@ -807,8 +805,6 @@ extension HomeViewController {
}
private func popUpNotification() {
- self.isShowTokenRenewAlert = true
-
// FIXME: Temporary expire date
let dateformat = DateFormatter()
dateformat.dateFormat = "yyyy-MM-dd"
diff --git a/GMERemittance/Module/Main/User Interface/Wireframe/MainWireframe.swift b/GMERemittance/Module/Main/User Interface/Wireframe/MainWireframe.swift
index 7272ab99..ca12e345 100644
--- a/GMERemittance/Module/Main/User Interface/Wireframe/MainWireframe.swift
+++ b/GMERemittance/Module/Main/User Interface/Wireframe/MainWireframe.swift
@@ -97,6 +97,8 @@ extension MainWireframe: MainWireframeInput {
store.removeObject(forKey: AppConstants.dateOfDontShowNotification)
store.removeObject(forKey: AppConstants.dateOfExpireNotification)
+ store.removeObject(forKey: AppConstants.isOpenedTokenRenwalAlert)
+ store.removeObject(forKey: AppConstants.isOpenedPopupNotification)
KeyChain.shared.save(data: "0", key: .login)
diff --git a/GMERemittance/Module/PopupNotification/User Interface/View/PopupNotificationViewController.swift b/GMERemittance/Module/PopupNotification/User Interface/View/PopupNotificationViewController.swift
index ce404ba7..183cd247 100644
--- a/GMERemittance/Module/PopupNotification/User Interface/View/PopupNotificationViewController.swift
+++ b/GMERemittance/Module/PopupNotification/User Interface/View/PopupNotificationViewController.swift
@@ -32,6 +32,7 @@ class PopupNotificationViewController: UIViewController {
// MARK: IBActions
@IBAction func touchDontShowAgainTodayButton(_ sender: UIButton) {
+ UserDefaults.standard.set(true, forKey: AppConstants.isOpenedPopupNotification)
// TODO: now를 기록.
let now = Date()
UserDefaults.standard.set(now, forKey: AppConstants.dateOfDontShowNotification)
@@ -39,6 +40,7 @@ class PopupNotificationViewController: UIViewController {
}
@IBAction func touchOkButton(_ sender: UIButton) {
+ UserDefaults.standard.set(true, forKey: AppConstants.isOpenedPopupNotification)
dismiss(animated: true, completion: nil)
}
diff --git a/GMERemittance/Module/PopupNotification/User Interface/Wireframe/PopupNotificationWireframe.swift b/GMERemittance/Module/PopupNotification/User Interface/Wireframe/PopupNotificationWireframe.swift
index 76a3fea6..b414d673 100644
--- a/GMERemittance/Module/PopupNotification/User Interface/Wireframe/PopupNotificationWireframe.swift
+++ b/GMERemittance/Module/PopupNotification/User Interface/Wireframe/PopupNotificationWireframe.swift
@@ -57,6 +57,8 @@ extension PopupNotificationWireframe: PopupNotificationWireframeInput {
UserDefaults.standard.removeObject(forKey: AppConstants.dateOfDontShowNotification)
}
- source.present(getMainView(), animated: true, completion: nil)
+ if !UserDefaults.standard.bool(forKey: AppConstants.isOpenedPopupNotification) {
+ source.present(getMainView(), animated: true, completion: nil)
+ }
}
}
diff --git a/GMERemittance/Utility/AppConstants.swift b/GMERemittance/Utility/AppConstants.swift
index 6f32c368..78d80d3e 100644
--- a/GMERemittance/Utility/AppConstants.swift
+++ b/GMERemittance/Utility/AppConstants.swift
@@ -35,6 +35,8 @@ class AppConstants {
static let accessTokenExpTime = "accessTokenExpTime"
static let dateOfDontShowNotification = "dateOfDontShowNotification"
static let dateOfExpireNotification = "dateOfExpireNotification"
+ static let isOpenedTokenRenwalAlert = "isOpenedTokenRenwalAlert"
+ static let isOpenedPopupNotification = "isOpenedPopupNotification"
}
enum Devices {