소스 검색

NCNetworkingProcessUpload only if noreground

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 년 전
부모
커밋
a180dab502
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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()