From 984a71017688eb0cca576a7e1c3e1e9cffff700b Mon Sep 17 00:00:00 2001 From: qodhrkawk Date: Fri, 19 Feb 2021 17:47:12 +0900 Subject: [PATCH 1/2] 1.054 --- BeMe/BeMe.xcodeproj/project.pbxproj | 4 ++-- BeMe/BeMe/Alarm/VCs/AlarmVC.swift | 1 + BeMe/BeMe/AppDelegate.swift | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BeMe/BeMe.xcodeproj/project.pbxproj b/BeMe/BeMe.xcodeproj/project.pbxproj index 0cd06aa..2a2736e 100644 --- a/BeMe/BeMe.xcodeproj/project.pbxproj +++ b/BeMe/BeMe.xcodeproj/project.pbxproj @@ -1934,7 +1934,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.053; + MARKETING_VERSION = 1.054; PRODUCT_BUNDLE_IDENTIFIER = com.teamBeMe.BeMe1; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1957,7 +1957,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.053; + MARKETING_VERSION = 1.054; PRODUCT_BUNDLE_IDENTIFIER = com.teamBeMe.BeMe1; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/BeMe/BeMe/Alarm/VCs/AlarmVC.swift b/BeMe/BeMe/Alarm/VCs/AlarmVC.swift index a25e9df..8b10a3c 100644 --- a/BeMe/BeMe/Alarm/VCs/AlarmVC.swift +++ b/BeMe/BeMe/Alarm/VCs/AlarmVC.swift @@ -27,6 +27,7 @@ class AlarmVC: UIViewController { super.viewWillAppear(animated) self.navigationController?.interactivePopGestureRecognizer?.delegate = nil getAlarms() + UIApplication.shared.applicationIconBadgeNumber = 0 } override func viewDidLoad() { diff --git a/BeMe/BeMe/AppDelegate.swift b/BeMe/BeMe/AppDelegate.swift index e3405f3..8b99f65 100644 --- a/BeMe/BeMe/AppDelegate.swift +++ b/BeMe/BeMe/AppDelegate.swift @@ -124,7 +124,7 @@ extension AppDelegate : UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter,didReceive response: UNNotificationResponse,withCompletionHandler completionHandler: @escaping () -> Void) { print("응 돼") - + UIApplication.shared.applicationIconBadgeNumber = 0 UserDefaults.standard.setValue("yes", forKey: "shouldShowAlert") // guard let navC = UIApplication.shared.delegate!.window!!.rootViewController! as? UINavigationController else {return} NotificationCenter.default.post(name: .fromPushAlert, object: nil) From 118a477e06a8e5fc5ab13d93fbbbc8759729f213 Mon Sep 17 00:00:00 2001 From: qodhrkawk Date: Sun, 21 Feb 2021 22:02:38 +0900 Subject: [PATCH 2/2] 1.05 --- BeMe/BeMe.xcodeproj/project.pbxproj | 4 ++-- BeMe/BeMe/Alarm/VCs/AlarmVC.swift | 5 +++++ BeMe/BeMe/AppDelegate.swift | 4 ++-- BeMe/BeMe/SceneDelegate.swift | 7 ++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/BeMe/BeMe.xcodeproj/project.pbxproj b/BeMe/BeMe.xcodeproj/project.pbxproj index 2a2736e..70ef9ea 100644 --- a/BeMe/BeMe.xcodeproj/project.pbxproj +++ b/BeMe/BeMe.xcodeproj/project.pbxproj @@ -1934,7 +1934,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.054; + MARKETING_VERSION = 1.0552; PRODUCT_BUNDLE_IDENTIFIER = com.teamBeMe.BeMe1; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -1957,7 +1957,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.054; + MARKETING_VERSION = 1.0552; PRODUCT_BUNDLE_IDENTIFIER = com.teamBeMe.BeMe1; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/BeMe/BeMe/Alarm/VCs/AlarmVC.swift b/BeMe/BeMe/Alarm/VCs/AlarmVC.swift index 8b10a3c..d731dd4 100644 --- a/BeMe/BeMe/Alarm/VCs/AlarmVC.swift +++ b/BeMe/BeMe/Alarm/VCs/AlarmVC.swift @@ -18,6 +18,7 @@ class AlarmVC: UIViewController { private var alarmArray: [Alarm] = [] { didSet { self.alarmTableView.reloadData() + LoadingHUD.hide() } } @@ -27,6 +28,9 @@ class AlarmVC: UIViewController { super.viewWillAppear(animated) self.navigationController?.interactivePopGestureRecognizer?.delegate = nil getAlarms() + + } + override func viewWillDisappear(_ animated: Bool) { UIApplication.shared.applicationIconBadgeNumber = 0 } @@ -58,6 +62,7 @@ extension AlarmVC { self.alarmArray.append(contentsOf: ad.activities) } + } case .requestErr(let message): diff --git a/BeMe/BeMe/AppDelegate.swift b/BeMe/BeMe/AppDelegate.swift index 8b99f65..84b12b2 100644 --- a/BeMe/BeMe/AppDelegate.swift +++ b/BeMe/BeMe/AppDelegate.swift @@ -88,7 +88,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MessagingDelegate { application.registerForRemoteNotifications() Messaging.messaging().delegate = self - UIApplication.shared.applicationIconBadgeNumber = 0 + return true } @@ -124,7 +124,7 @@ extension AppDelegate : UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter,didReceive response: UNNotificationResponse,withCompletionHandler completionHandler: @escaping () -> Void) { print("응 돼") - UIApplication.shared.applicationIconBadgeNumber = 0 + UserDefaults.standard.setValue("yes", forKey: "shouldShowAlert") // guard let navC = UIApplication.shared.delegate!.window!!.rootViewController! as? UINavigationController else {return} NotificationCenter.default.post(name: .fromPushAlert, object: nil) diff --git a/BeMe/BeMe/SceneDelegate.swift b/BeMe/BeMe/SceneDelegate.swift index de5ca3a..129f32e 100644 --- a/BeMe/BeMe/SceneDelegate.swift +++ b/BeMe/BeMe/SceneDelegate.swift @@ -26,6 +26,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { var rootVc = storyBoard.instantiateViewController(identifier: "UnderTabBarController") // var storyBoard = UIStoryboard(name: "Onboarding", bundle: nil) // var rootVc = storyBoard.instantiateViewController(identifier: "OnboardingVC") + if let token = defaults.string(forKey: "token"){ // 자동로그인 -> 메인뷰 @@ -95,13 +96,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This occurs shortly after the scene enters the background, or when its session is discarded. // Release any resources associated with this scene that can be re-created the next time the scene connects. // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + NotificationCenter.default.addObserver(self, selector: #selector(showAlert(_:)), name: .fromPushAlert, object: nil) } func sceneDidBecomeActive(_ scene: UIScene) { // Called when the scene has moved from an inactive state to an active state. // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. - + NotificationCenter.default.addObserver(self, selector: #selector(showAlert(_:)), name: .fromPushAlert, object: nil) } @@ -122,17 +124,20 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func sceneWillResignActive(_ scene: UIScene) { // Called when the scene will move from an active state to an inactive state. // This may occur due to temporary interruptions (ex. an incoming phone call). + NotificationCenter.default.addObserver(self, selector: #selector(showAlert(_:)), name: .fromPushAlert, object: nil) } func sceneWillEnterForeground(_ scene: UIScene) { // Called as the scene transitions from the background to the foreground. // Use this method to undo the changes made on entering the background. + NotificationCenter.default.addObserver(self, selector: #selector(showAlert(_:)), name: .fromPushAlert, object: nil) } func sceneDidEnterBackground(_ scene: UIScene) { // Called as the scene transitions from the foreground to the background. // Use this method to save data, release shared resources, and store enough scene-specific state information // to restore the scene back to its current state. + NotificationCenter.default.addObserver(self, selector: #selector(showAlert(_:)), name: .fromPushAlert, object: nil) }