Exclude all items from iCloud backup

Signed-off-by: Andy Uhnak <andyuhnak@gmail.com>
This commit is contained in:
Andy Uhnak
2022-02-08 14:04:00 +00:00
parent 7964d314c8
commit 4c841fc6b2
5 changed files with 31 additions and 5 deletions
@@ -16,6 +16,7 @@
import Foundation
import Intents
import MatrixSDK
#if DEBUG
import FLEX
@@ -79,6 +80,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
func start() {
self.setupLogger()
self.setupTheme()
self.excludeAllItemsFromBackup()
// Setup navigation router store
_ = NavigationRouterStore.shared
@@ -129,6 +131,17 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
}
}
private func excludeAllItemsFromBackup() {
let manager = FileManager.default
// Individual files and directories created by the application or SDK are excluded case-by-case,
// but sometimes the lifecycle of a file is not directly controlled by the app (e.g. plists for
// UserDefaults). For that reason the app will always exclude all top-level directories as well
// as individual files.
manager.excludeAllUserDirectoriesFromBackup()
manager.excludeAllAppGroupDirectoriesFromBackup()
}
private func showAuthentication() {
// TODO: Implement
}