marinofaggiana %!s(int64=4) %!d(string=hai) anos
pai
achega
3a09ab66d3
Modificáronse 2 ficheiros con 36 adicións e 69 borrados
  1. 0 30
      Libraries external/Imagemeter/IMCreate.swift
  2. 36 39
      iOSClient/AppDelegate.swift

+ 0 - 30
Libraries external/Imagemeter/IMCreate.swift

@@ -1,30 +0,0 @@
-//
-//  IMCreate.swift
-//  HandwerkCloud
-//
-//  Created by Marino Faggiana on 17/11/2019.
-//  Copyright (c) 2019 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-import Foundation
-
-class IMCreate: NSObject {
-    init(serverUrl: String) {
-        super.init()
-    }
-}

+ 36 - 39
iOSClient/AppDelegate.swift

@@ -78,69 +78,66 @@ class AppDelegate: UIResponder, UIApplicationDelegate, TOPasscodeViewControllerD
         return true
     }
 
-    // L' applicazione si dimetterà dallo stato di attivo
-    func applicationWillResignActive(_ application: UIApplication) {
-        
-        if account == "" { return}
+    // L' applicazione entrerà in primo piano (attivo sempre)
+    func applicationDidBecomeActive(_ application: UIApplication) {
         
-        if activeFileViewInFolder != nil {
-            activeFileViewInFolder?.dismiss(animated: false, completion: {
-                self.activeFileViewInFolder = nil
-            })
-        }
-    }
-
-    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
-    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-    func applicationDidEnterBackground(_ application: UIApplication) {
+        NCSettingsBundleHelper.setVersionAndBuildNumber()
         
         if account == "" { return}
-        
-        NCCommunicationCommon.shared.writeLog("Application did enter in background")
-        
-        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterApplicationDidEnterBackground)
-        
-        passcodeWithAutomaticallyPromptForBiometricValidation(false)
-        
-        if #available(iOS 13.0, *) {
-            
-        }
-    }
 
+        NCNetworking.shared.verifyUploadZombie()
+    }
+    
     // L' applicazione entrerà in primo piano (attivo solo dopo il background)
-    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
     func applicationWillEnterForeground(_ application: UIApplication) {
         
         if account == "" { return}
 
         NCCommunicationCommon.shared.writeLog("Application will enter in foreground")
         
-        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterApplicationWillEnterForeground)
-
         // Request Passcode
         passcodeWithAutomaticallyPromptForBiometricValidation(true)
         
         // Initialize Auto upload
         NCAutoUpload.shared.initAutoUpload(viewController: nil) { (_) in }
-        
-        // Read active directory
-        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
-        
+                
         // Required unsubscribing / subscribing
         NCPushNotification.shared().pushNotification()
         
-        // RichDocument
-        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterRichdocumentGrabFocus)
-        
         // Request Service Server Nextcloud
         NCService.shared.startRequestServicesServer()
+        
+        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterApplicationWillEnterForeground)
+        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterRichdocumentGrabFocus)
+        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterReloadDataSourceNetworkForced)
     }
 
-    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-    func applicationDidBecomeActive(_ application: UIApplication) {
+    func applicationWillResignActive(_ application: UIApplication) {
+        
+        if account == "" { return}
+        
+        if activeFileViewInFolder != nil {
+            activeFileViewInFolder?.dismiss(animated: false, completion: {
+                self.activeFileViewInFolder = nil
+            })
+        }
     }
-
-    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+    
+    func applicationDidEnterBackground(_ application: UIApplication) {
+        
+        if account == "" { return}
+        
+        NCCommunicationCommon.shared.writeLog("Application did enter in background")
+        
+        NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterApplicationDidEnterBackground)
+        
+        passcodeWithAutomaticallyPromptForBiometricValidation(false)
+        
+        if #available(iOS 13.0, *) {
+            
+        }
+    }
+    
     func applicationWillTerminate(_ application: UIApplication) {
         NCCommunicationCommon.shared.writeLog("bye bye")
     }