Skip to content

Commit

Permalink
Use foreground URLSession in Main App for WebDAV
Browse files Browse the repository at this point in the history
  • Loading branch information
phil1995 committed Dec 10, 2020
1 parent 3495665 commit ff3f534
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Foundation
public class CloudProviderManager {
static var cachedProvider = [String: CloudProvider]()
public static let shared = CloudProviderManager(accountManager: CloudProviderAccountManager.shared)
public var useBackgroundSession = true
let accountManager: CloudProviderAccountManager

init(accountManager: CloudProviderAccountManager) {
Expand Down Expand Up @@ -38,7 +39,7 @@ public class CloudProviderManager {
guard let credential = WebDAVAuthenticator.getCredentialFromKeychain(with: accountUID) else {
throw CloudProviderAccountError.accountNotFoundError
}
let client = WebDAVClient(credential: credential, sharedContainerIdentifier: CryptomatorConstants.appGroupName, useBackgroundSession: true)
let client = WebDAVClient(credential: credential, sharedContainerIdentifier: CryptomatorConstants.appGroupName, useBackgroundSession: useBackgroundSession)
provider = WebDAVProvider(with: client)
default:
throw CloudProviderAccountError.accountNotFoundError
Expand Down
1 change: 1 addition & 0 deletions Cryptomator/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
}.catch { error in
print("removeAllUnusedFileProviderDomains failed with error: \(error)")
}
CloudProviderManager.shared.useBackgroundSession = false
window = UIWindow(frame: UIScreen.main.bounds)
let navigationController = UINavigationController(rootViewController: WebDAVLoginViewController())
window?.rootViewController = navigationController
Expand Down

0 comments on commit ff3f534

Please sign in to comment.