marinofaggiana vor 4 Jahren
Ursprung
Commit
2c544f9444
1 geänderte Dateien mit 11 neuen und 3 gelöschten Zeilen
  1. 11 3
      iOSClient/AppDelegate.m

+ 11 - 3
iOSClient/AppDelegate.m

@@ -556,10 +556,18 @@
 
 -(void)handleRefreshTask:(BGTask *)task API_AVAILABLE(ios(13.0))
 {
+    if (self.account == nil || self.account.length == 0) {
+        [task setTaskCompletedWithSuccess:true];
+        return;
+    }
+    
     [[NCCommunicationCommon shared] writeLog:@"Start handler refresh task"];
-    [[NCCommunicationCommon shared] writeLog:@"Completition handler refresh task"];
-
-    [task setTaskCompletedWithSuccess:true];
+    
+    // Verify new photo
+    [[NCAutoUpload shared] initAutoUploadWithViewController:nil completion:^(NSInteger items) {
+        [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"Completition handler refresh task with %lu uploads", (unsigned long)items]];
+        [task setTaskCompletedWithSuccess:true];
+    }];
 }
 
 -(void)handleProcessingTask:(BGTask *)task API_AVAILABLE(ios(13.0))