Browse Source

NCNetworkingProcessUpload only if noreground

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
a180dab502
1 changed files with 3 additions and 1 deletions
  1. 3 1
      iOSClient/AppDelegate.swift

+ 3 - 1
iOSClient/AppDelegate.swift

@@ -152,7 +152,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize, userInfo:["atStart":1])
 
         // Process upload
-        networkingProcessUpload = NCNetworkingProcessUpload()
+        if UIApplication.shared.applicationState != .background {
+            networkingProcessUpload = NCNetworkingProcessUpload()
+        }
 
         // Push Notification & display notification
         application.registerForRemoteNotifications()