Browse Source

create not-so-good performFetchWithCompletionHandler implementation

B. Petersen 5 năm trước cách đây
mục cha
commit
d119da3761
1 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 5 4
      deltachat-ios/AppDelegate.swift

+ 5 - 4
deltachat-ios/AppDelegate.swift

@@ -90,13 +90,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         return true
     }
 
+
     func application(_: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
         logger.info("---- background-fetch ----")
+        startThreads()
 
-        startThreads {
-            // TODO: actually set the right value depending on if we found sth
-            completionHandler(.newData)
-        }
+        // TODO-ASYNC: implement that correctly
+        sleep(15)
+        completionHandler(.newData)
     }
 
     func applicationWillEnterForeground(_: UIApplication) {