From e371d31bd6676a2883ae949479c010be4c0a450b Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 24 Mar 2024 23:36:05 -0700 Subject: [PATCH] Switch to async didReceiveRemoteNotification. --- iOS/AppDelegate.swift | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index a546b04b8..f19d2809d 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -125,19 +125,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD #endif return true - } - func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { - DispatchQueue.main.async { - self.resumeDatabaseProcessingIfNecessary() - self.accountManager.receiveRemoteNotification(userInfo: userInfo) { - self.suspendApplication() - completionHandler(.newData) - } - } - } - + func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) async -> UIBackgroundFetchResult { + + resumeDatabaseProcessingIfNecessary() + await accountManager.receiveRemoteNotification(userInfo: userInfo) + suspendApplication() + return .newData + } + func applicationWillTerminate(_ application: UIApplication) { shuttingDown = true }