Przeglądaj źródła

fix

Signed-off-by: Marino Faggiana <96728420+MarinoFaggianaAstraIridium@users.noreply.github.com>
Marino Faggiana 2 lat temu
rodzic
commit
ba2271412c

+ 2 - 0
iOSClient/AppDelegate.swift

@@ -61,6 +61,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
 
+        NCSettingsBundleHelper.checkAndExecuteSettings()
+
         let userAgent = CCUtility.getUserAgent() as String
         let versionNextcloudiOS = String(format: NCBrandOptions.shared.textCopyrightNextcloudiOS, NCUtility.shared.getVersionApp())
 

+ 18 - 0
iOSClient/Settings/NCSettingsBundleHelper.swift

@@ -38,6 +38,24 @@ class NCSettingsBundleHelper: NSObject {
     class func checkAndExecuteSettings() {
         if UserDefaults.standard.bool(forKey: SettingsBundleKeys.Reset) {
             UserDefaults.standard.set(false, forKey: SettingsBundleKeys.Reset)
+
+            let content = UNMutableNotificationContent()
+            content.title = NCBrandOptions.shared.brand
+            content.body = NSLocalizedString("_reset_application_done_", comment: "")
+            let req = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil)
+            let notificationCenter = UNUserNotificationCenter.current()
+            notificationCenter.add(req)
+
+            URLCache.shared.memoryCapacity = 0
+            URLCache.shared.diskCapacity = 0
+
+            CCUtility.removeGroupDirectoryProviderStorage()
+            CCUtility.removeGroupApplicationSupport()
+            CCUtility.removeDocumentsDirectory()
+            CCUtility.removeTemporaryDirectory()
+
+            CCUtility.deleteAllChainStore()
+            NCManageDatabase.shared.removeDB()
         }
     }
 }

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -926,6 +926,7 @@
 "_undo_modify_"             = "Undo the modify";
 "_unauthorizedFilesPasscode_" = "Files cannot be used with an activated passcode";
 "_disableFilesApp_"         = "Files cannot be used because is disabled";
+"_reset_application_done_"  = "Reset application, done.";
 
 // Video
 "_select_trace_"            = "Select the trace";