From 4135ba54fb03e96577329e524e9638ceace61789 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 24 Apr 2019 16:29:32 -0500 Subject: [PATCH] Add debug statements --- iOS/AppDelegate.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 9144f88c0..87c7101e5 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -154,7 +154,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele completionHandler() } - DispatchQueue.global(qos: .background).async { + logDebugMessage("Handle background URL Session.") + + DispatchQueue.global(qos: .background).async { [unowned self] in // Set up a background task to let iOS know not to kill us self.backgroundUpdateTask = UIApplication.shared.beginBackgroundTask { @@ -177,6 +179,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele } } + self.logDebugMessage("Completed processing background URL Session.") + UIApplication.shared.endBackgroundTask(self.backgroundUpdateTask) self.backgroundUpdateTask = UIBackgroundTaskIdentifier.invalid @@ -185,6 +189,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele } func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { + logDebugMessage("Woken to fetch articles.") AccountManager.shared.refreshAll() completionHandler(.newData) }