marinofaggiana 4 жил өмнө
parent
commit
acc3e725dd

+ 5 - 3
iOSClient/AppDelegate.m

@@ -210,9 +210,6 @@
     // Request Passcode
     [self passcodeWithAutomaticallyPromptForBiometricValidation:true];
     
-    // Request Service Server Nextcloud
-    [[NCService shared] startRequestServicesServer];
-    
     // Initialize Auto upload
     [[NCAutoUpload sharedInstance] initStateAutoUpload];
     
@@ -224,6 +221,11 @@
     
     // RichDocument
     [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_richdocumentGrabFocus object:nil];
+    
+    // Request Service Server Nextcloud
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
+        [[NCService shared] startRequestServicesServer];
+    });
 }
 
 //

+ 7 - 0
iOSClient/Networking/NCService.swift

@@ -41,6 +41,13 @@ class NCService: NSObject {
             return
         }
         
+        if UIApplication.shared.applicationState == .background {
+            NCCommunicationCommon.shared.writeLog("[LOG] Request Services Server aborted because in background")
+            return
+        } else {
+            NCCommunicationCommon.shared.writeLog("[LOG] Start Request Services Server")
+        }
+
         self.requestUserProfile()
         self.requestServerStatus()
     }