From e8fffdf2ff80f9cd529a8e36fd60a03a4cfbfcab Mon Sep 17 00:00:00 2001 From: Azuma Kasumi Date: Mon, 15 Aug 2022 12:24:53 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=82=A2=E3=82=B0?= =?UTF-8?q?=E3=83=A9=E3=82=A6=E3=83=B3=E3=83=89=E6=99=82=E3=81=AE=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8F=96=E5=BE=97=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AgileWorks/AgileWorks/App/AppDelegate.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/AgileWorks/AgileWorks/App/AppDelegate.swift b/AgileWorks/AgileWorks/App/AppDelegate.swift index 3d5aa7c..b6260c0 100644 --- a/AgileWorks/AgileWorks/App/AppDelegate.swift +++ b/AgileWorks/AgileWorks/App/AppDelegate.swift @@ -16,6 +16,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { //var currentAuthorizationFlow: OIDExternalUserAgentSession? let gcmMessageIDKey = "gcm.message_id" private let appShared: AppShared = AppShared() + //フォアグランドで通知をタップした際のフラグ + private var openForeground = false func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) @@ -155,7 +157,8 @@ extension AppDelegate: UNUserNotificationCenterDelegate { } log.debug(userInfo) - Linker.handleRemoteNotification(userInfo) + //Linker.handleRemoteNotification(userInfo) + openForeground = true if let aps = userInfo["aps"] as? [AnyHashable: Any], let badge = aps["badge"] as? Int { UIApplication.shared.applicationIconBadgeNumber = badge @@ -176,6 +179,10 @@ extension AppDelegate: UNUserNotificationCenterDelegate { log.debug(userInfo) Linker.handleRemoteNotification(userInfo) + if openForeground { + Linker.checkLink() + openForeground = false + } completionHandler() } -- GitLab From cfdbd4e85f7f287a2523ba85399d594e796cc246 Mon Sep 17 00:00:00 2001 From: Azuma Kasumi Date: Mon, 15 Aug 2022 14:12:55 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=82=A2=E3=83=97=E3=83=AA=E8=B5=B7?= =?UTF-8?q?=E5=8B=95=E7=8A=B6=E6=85=8B=E3=82=92=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AgileWorks/AgileWorks/App/AppDelegate.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/AgileWorks/AgileWorks/App/AppDelegate.swift b/AgileWorks/AgileWorks/App/AppDelegate.swift index b6260c0..84ff5cb 100644 --- a/AgileWorks/AgileWorks/App/AppDelegate.swift +++ b/AgileWorks/AgileWorks/App/AppDelegate.swift @@ -16,8 +16,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { //var currentAuthorizationFlow: OIDExternalUserAgentSession? let gcmMessageIDKey = "gcm.message_id" private let appShared: AppShared = AppShared() - //フォアグランドで通知をタップした際のフラグ - private var openForeground = false func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { window = UIWindow(frame: UIScreen.main.bounds) @@ -157,8 +155,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate { } log.debug(userInfo) - //Linker.handleRemoteNotification(userInfo) - openForeground = true if let aps = userInfo["aps"] as? [AnyHashable: Any], let badge = aps["badge"] as? Int { UIApplication.shared.applicationIconBadgeNumber = badge @@ -179,9 +175,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate { log.debug(userInfo) Linker.handleRemoteNotification(userInfo) - if openForeground { + //フォアグラウンド時に通知タップで書類を開く + if(UIApplication.shared.applicationState == .active){ Linker.checkLink() - openForeground = false } completionHandler() -- GitLab