Quellcode durchsuchen

execute performFetch() also on notify-remote-launch

B. Petersen vor 3 Jahren
Ursprung
Commit
16b9739a3b
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
  1. 5 1
      deltachat-ios/AppDelegate.swift

+ 5 - 1
deltachat-ios/AppDelegate.swift

@@ -145,6 +145,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             self.pushToDebugArray("📡'")
             logger.info("Notifications: remoteNotification: \(String(describing: notificationOption))")
             increaseDebugCounter("notify-remote-launch")
+            performFetch(completionHandler: dummyCompletionHandler)
         }
 
         if dcAccounts.getSelected().isConfigured() && !UserDefaults.standard.bool(forKey: "notifications_disabled") {
@@ -158,6 +159,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         return true
     }
 
+    func dummyCompletionHandler(_ result: UIBackgroundFetchResult) {
+    }
+
     // `open` is called when an url should be opened by Delta Chat.
     // we currently use that for handling oauth2 and for handing openpgp4fpr.
     //
@@ -587,7 +591,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         UserDefaults.standard.set(nowTimestamp, forKey: name + "-last")
 
         // Values calculated for connectivity view
-        if name == "notify-remote-receive" || name == "notify-local-wakeup" {
+        if name == "notify-remote-receive" || name == "notify-remote-launch" || name == "notify-local-wakeup" {
             let timestamps = UserDefaults.standard.array(forKey: Constants.Keys.notificationTimestamps)
             var slidingTimeframe: [Double]
             if timestamps != nil, let timestamps = timestamps as? [Double] {