|
@@ -381,11 +381,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
// Schedule a new task.
|
|
|
scheduleAppRefresh()
|
|
|
|
|
|
- if account == "" {
|
|
|
+ guard !account.isEmpty else {
|
|
|
task.setTaskCompleted(success: true)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
NKCommon.shared.writeLog("Start handler refresh task [Auto upload]")
|
|
|
|
|
|
NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
@@ -399,7 +399,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
// Schedule a new task.
|
|
|
scheduleAppProcessing()
|
|
|
|
|
|
- if account == "" {
|
|
|
+ guard !account.isEmpty else {
|
|
|
task.setTaskCompleted(success: true)
|
|
|
return
|
|
|
}
|
|
@@ -418,27 +418,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // MARK: - Fetch
|
|
|
-
|
|
|
- func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
|
|
-
|
|
|
- if account == "" {
|
|
|
- completionHandler(UIBackgroundFetchResult.noData)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- NKCommon.shared.writeLog("Start perform Fetch [Auto upload]")
|
|
|
-
|
|
|
- NCAutoUpload.shared.initAutoUpload(viewController: nil) { items in
|
|
|
- NKCommon.shared.writeLog("Completition perform Fetch with \(items) uploads [Auto upload]")
|
|
|
- if items == 0 {
|
|
|
- completionHandler(UIBackgroundFetchResult.noData)
|
|
|
- } else {
|
|
|
- completionHandler(UIBackgroundFetchResult.newData)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// MARK: - Background Networking Session
|
|
|
|
|
|
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
|