|
@@ -29,20 +29,21 @@ import Firebase
|
|
import WidgetKit
|
|
import WidgetKit
|
|
import Queuer
|
|
import Queuer
|
|
import EasyTipView
|
|
import EasyTipView
|
|
|
|
+import SwiftUI
|
|
|
|
|
|
@UIApplicationMain
|
|
@UIApplicationMain
|
|
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, NCUserBaseUrl {
|
|
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate, NCUserBaseUrl {
|
|
|
|
|
|
- @objc var account: String = ""
|
|
|
|
- @objc var urlBase: String = ""
|
|
|
|
- @objc var user: String = ""
|
|
|
|
- @objc var userId: String = ""
|
|
|
|
- @objc var password: String = ""
|
|
|
|
|
|
+ var account: String = ""
|
|
|
|
+ var urlBase: String = ""
|
|
|
|
+ var user: String = ""
|
|
|
|
+ var userId: String = ""
|
|
|
|
+ var password: String = ""
|
|
|
|
|
|
var tipView: EasyTipView?
|
|
var tipView: EasyTipView?
|
|
var backgroundSessionCompletionHandler: (() -> Void)?
|
|
var backgroundSessionCompletionHandler: (() -> Void)?
|
|
var activeLogin: NCLogin?
|
|
var activeLogin: NCLogin?
|
|
- var activeLoginWeb: NCLoginWeb?
|
|
|
|
|
|
+ var activeLoginWeb: NCLoginProvider?
|
|
var timerErrorNetworking: Timer?
|
|
var timerErrorNetworking: Timer?
|
|
var timerErrorNetworkingDisabled: Bool = false
|
|
var timerErrorNetworkingDisabled: Bool = false
|
|
var taskAutoUploadDate: Date = Date()
|
|
var taskAutoUploadDate: Date = Date()
|
|
@@ -51,6 +52,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
}
|
|
}
|
|
var notificationSettings: UNNotificationSettings?
|
|
var notificationSettings: UNNotificationSettings?
|
|
|
|
|
|
|
|
+ var loginFlowV2Token = ""
|
|
|
|
+ var loginFlowV2Endpoint = ""
|
|
|
|
+ var loginFlowV2Login = ""
|
|
|
|
+
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
if isUiTestingEnabled {
|
|
if isUiTestingEnabled {
|
|
deleteAllAccounts()
|
|
deleteAllAccounts()
|
|
@@ -183,8 +188,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
@discussion Schedule a refresh task request to ask that the system launch your app briefly so that you can download data and keep your app's contents up-to-date. The system will fulfill this request intelligently based on system conditions and app usage.
|
|
@discussion Schedule a refresh task request to ask that the system launch your app briefly so that you can download data and keep your app's contents up-to-date. The system will fulfill this request intelligently based on system conditions and app usage.
|
|
*/
|
|
*/
|
|
func scheduleAppRefresh() {
|
|
func scheduleAppRefresh() {
|
|
-
|
|
|
|
let request = BGAppRefreshTaskRequest(identifier: NCGlobal.shared.refreshTask)
|
|
let request = BGAppRefreshTaskRequest(identifier: NCGlobal.shared.refreshTask)
|
|
|
|
+
|
|
request.earliestBeginDate = Date(timeIntervalSinceNow: 60) // Refresh after 60 seconds.
|
|
request.earliestBeginDate = Date(timeIntervalSinceNow: 60) // Refresh after 60 seconds.
|
|
do {
|
|
do {
|
|
try BGTaskScheduler.shared.submit(request)
|
|
try BGTaskScheduler.shared.submit(request)
|
|
@@ -197,8 +202,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
@discussion Schedule a processing task request to ask that the system launch your app when conditions are favorable for battery life to handle deferrable, longer-running processing, such as syncing, database maintenance, or similar tasks. The system will attempt to fulfill this request to the best of its ability within the next two days as long as the user has used your app within the past week.
|
|
@discussion Schedule a processing task request to ask that the system launch your app when conditions are favorable for battery life to handle deferrable, longer-running processing, such as syncing, database maintenance, or similar tasks. The system will attempt to fulfill this request to the best of its ability within the next two days as long as the user has used your app within the past week.
|
|
*/
|
|
*/
|
|
func scheduleAppProcessing() {
|
|
func scheduleAppProcessing() {
|
|
-
|
|
|
|
let request = BGProcessingTaskRequest(identifier: NCGlobal.shared.processingTask)
|
|
let request = BGProcessingTaskRequest(identifier: NCGlobal.shared.processingTask)
|
|
|
|
+
|
|
request.earliestBeginDate = Date(timeIntervalSinceNow: 5 * 60) // Refresh after 5 minutes.
|
|
request.earliestBeginDate = Date(timeIntervalSinceNow: 5 * 60) // Refresh after 5 minutes.
|
|
request.requiresNetworkConnectivity = false
|
|
request.requiresNetworkConnectivity = false
|
|
request.requiresExternalPower = false
|
|
request.requiresExternalPower = false
|
|
@@ -270,7 +275,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
// MARK: - Background Networking Session
|
|
// MARK: - Background Networking Session
|
|
|
|
|
|
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
|
|
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
|
|
-
|
|
|
|
NextcloudKit.shared.nkCommonInstance.writeLog("[DEBUG] Start handle Events For Background URLSession: \(identifier)")
|
|
NextcloudKit.shared.nkCommonInstance.writeLog("[DEBUG] Start handle Events For Background URLSession: \(identifier)")
|
|
WidgetCenter.shared.reloadAllTimelines()
|
|
WidgetCenter.shared.reloadAllTimelines()
|
|
backgroundSessionCompletionHandler = completionHandler
|
|
backgroundSessionCompletionHandler = completionHandler
|
|
@@ -283,7 +287,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
}
|
|
}
|
|
|
|
|
|
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
|
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
|
|
-
|
|
|
|
if let pref = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroups),
|
|
if let pref = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroups),
|
|
let data = pref.object(forKey: "NOTIFICATION_DATA") as? [String: AnyObject] {
|
|
let data = pref.object(forKey: "NOTIFICATION_DATA") as? [String: AnyObject] {
|
|
nextcloudPushNotificationAction(data: data)
|
|
nextcloudPushNotificationAction(data: data)
|
|
@@ -296,13 +299,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
|
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
|
NCNetworking.shared.checkPushNotificationServerProxyCertificateUntrusted(viewController: UIApplication.shared.firstWindow?.rootViewController) { error in
|
|
NCNetworking.shared.checkPushNotificationServerProxyCertificateUntrusted(viewController: UIApplication.shared.firstWindow?.rootViewController) { error in
|
|
if error == .success {
|
|
if error == .success {
|
|
- NCPushNotification.shared().registerForRemoteNotifications(withDeviceToken: deviceToken)
|
|
|
|
|
|
+ NCPushNotification.shared.registerForRemoteNotificationsWithDeviceToken(deviceToken)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
|
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
|
- NCPushNotification.shared().applicationdidReceiveRemoteNotification(userInfo) { result in
|
|
|
|
|
|
+ NCPushNotification.shared.applicationdidReceiveRemoteNotification(userInfo: userInfo) { result in
|
|
completionHandler(result)
|
|
completionHandler(result)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -340,7 +343,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
// MARK: - Login
|
|
// MARK: - Login
|
|
|
|
|
|
- @objc func openLogin(selector: Int, openLoginWeb: Bool, windowForRootViewController: UIWindow? = nil) {
|
|
|
|
|
|
+ func openLogin(selector: Int, openLoginWeb: Bool, windowForRootViewController: UIWindow? = nil) {
|
|
func showLoginViewController(_ viewController: UIViewController?) {
|
|
func showLoginViewController(_ viewController: UIViewController?) {
|
|
guard let viewController else { return }
|
|
guard let viewController else { return }
|
|
let navigationController = NCLoginNavigationController(rootViewController: viewController)
|
|
let navigationController = NCLoginNavigationController(rootViewController: viewController)
|
|
@@ -361,45 +364,55 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
}
|
|
}
|
|
|
|
|
|
// [WEBPersonalized] [AppConfig]
|
|
// [WEBPersonalized] [AppConfig]
|
|
- if NCBrandOptions.shared.use_login_web_personalized || NCBrandOptions.shared.use_AppConfig {
|
|
|
|
- if activeLoginWeb?.view.window == nil {
|
|
|
|
- activeLoginWeb = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginWeb") as? NCLoginWeb
|
|
|
|
- activeLoginWeb?.urlBase = NCBrandOptions.shared.loginBaseUrl
|
|
|
|
- showLoginViewController(activeLoginWeb)
|
|
|
|
|
|
+ if NCBrandOptions.shared.use_AppConfig {
|
|
|
|
+ if activeLogin?.view.window == nil {
|
|
|
|
+ urlBase = NCBrandOptions.shared.loginBaseUrl
|
|
|
|
+ NextcloudKit.shared.getLoginFlowV2(serverUrl: urlBase) { token, endpoint, login, _, error in
|
|
|
|
+ // Login Flow V2
|
|
|
|
+ if error == .success, let token, let endpoint, let login {
|
|
|
|
+ let vc = UIHostingController(rootView: NCLoginPoll(loginFlowV2Token: token, loginFlowV2Endpoint: endpoint, loginFlowV2Login: login, cancelButtonDisabled: NCManageDatabase.shared.getAccounts().isEmptyOrNil))
|
|
|
|
+ UIApplication.shared.firstWindow?.rootViewController?.present(vc, animated: true)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return
|
|
}
|
|
}
|
|
- return
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// Nextcloud standard login
|
|
// Nextcloud standard login
|
|
if selector == NCGlobal.shared.introSignup {
|
|
if selector == NCGlobal.shared.introSignup {
|
|
- if activeLoginWeb?.view.window == nil {
|
|
|
|
- activeLoginWeb = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginWeb") as? NCLoginWeb
|
|
|
|
|
|
+ if activeLogin?.view.window == nil {
|
|
|
|
+ activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
|
|
if selector == NCGlobal.shared.introSignup {
|
|
if selector == NCGlobal.shared.introSignup {
|
|
- activeLoginWeb?.urlBase = NCBrandOptions.shared.linkloginPreferredProviders
|
|
|
|
|
|
+ activeLogin?.urlBase = NCBrandOptions.shared.linkloginPreferredProviders
|
|
|
|
+ let web = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginProvider") as? NCLoginProvider
|
|
|
|
+ web?.urlBase = NCBrandOptions.shared.linkloginPreferredProviders
|
|
|
|
+ showLoginViewController(web)
|
|
} else {
|
|
} else {
|
|
- activeLoginWeb?.urlBase = self.urlBase
|
|
|
|
|
|
+ activeLogin?.urlBase = self.urlBase
|
|
|
|
+ showLoginViewController(activeLogin)
|
|
}
|
|
}
|
|
- showLoginViewController(activeLoginWeb)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
} else if NCBrandOptions.shared.disable_intro && NCBrandOptions.shared.disable_request_login_url {
|
|
} else if NCBrandOptions.shared.disable_intro && NCBrandOptions.shared.disable_request_login_url {
|
|
- if activeLoginWeb?.view.window == nil {
|
|
|
|
- activeLoginWeb = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginWeb") as? NCLoginWeb
|
|
|
|
- activeLoginWeb?.urlBase = NCBrandOptions.shared.loginBaseUrl
|
|
|
|
- showLoginViewController(activeLoginWeb)
|
|
|
|
|
|
+ if activeLogin?.view.window == nil {
|
|
|
|
+ activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
|
|
|
|
+ activeLogin?.urlBase = NCBrandOptions.shared.loginBaseUrl
|
|
|
|
+ showLoginViewController(activeLogin)
|
|
}
|
|
}
|
|
-
|
|
|
|
} else if openLoginWeb {
|
|
} else if openLoginWeb {
|
|
// Used also for reinsert the account (change passwd)
|
|
// Used also for reinsert the account (change passwd)
|
|
- if activeLoginWeb?.view.window == nil {
|
|
|
|
- activeLoginWeb = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginWeb") as? NCLoginWeb
|
|
|
|
- activeLoginWeb?.urlBase = urlBase
|
|
|
|
- activeLoginWeb?.user = user
|
|
|
|
- showLoginViewController(activeLoginWeb)
|
|
|
|
|
|
+ if activeLogin?.view.window == nil {
|
|
|
|
+ activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
|
|
|
|
+ activeLogin?.urlBase = urlBase
|
|
|
|
+ activeLogin?.disableUrlField = true
|
|
|
|
+ activeLogin?.disableCloseButton = true
|
|
|
|
+ showLoginViewController(activeLogin)
|
|
}
|
|
}
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
if activeLogin?.view.window == nil {
|
|
if activeLogin?.view.window == nil {
|
|
|
|
+ activeLogin?.disableCloseButton = true
|
|
|
|
+
|
|
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
|
|
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin
|
|
showLoginViewController(activeLogin)
|
|
showLoginViewController(activeLogin)
|
|
}
|
|
}
|
|
@@ -408,7 +421,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
// MARK: - Error Networking
|
|
// MARK: - Error Networking
|
|
|
|
|
|
- @objc func startTimerErrorNetworking(scene: UIScene) {
|
|
|
|
|
|
+ func startTimerErrorNetworking(scene: UIScene) {
|
|
timerErrorNetworkingDisabled = false
|
|
timerErrorNetworkingDisabled = false
|
|
timerErrorNetworking = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(checkErrorNetworking(_:)), userInfo: nil, repeats: true)
|
|
timerErrorNetworking = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(checkErrorNetworking(_:)), userInfo: nil, repeats: true)
|
|
}
|
|
}
|
|
@@ -421,13 +434,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
}
|
|
}
|
|
|
|
|
|
func trustCertificateError(host: String) {
|
|
func trustCertificateError(host: String) {
|
|
-
|
|
|
|
guard let currentHost = URL(string: self.urlBase)?.host,
|
|
guard let currentHost = URL(string: self.urlBase)?.host,
|
|
let pushNotificationServerProxyHost = URL(string: NCBrandOptions.shared.pushNotificationServerProxy)?.host,
|
|
let pushNotificationServerProxyHost = URL(string: NCBrandOptions.shared.pushNotificationServerProxy)?.host,
|
|
host != pushNotificationServerProxyHost,
|
|
host != pushNotificationServerProxyHost,
|
|
host == currentHost
|
|
host == currentHost
|
|
else { return }
|
|
else { return }
|
|
-
|
|
|
|
let certificateHostSavedPath = NCUtilityFileSystem().directoryCertificates + "/" + host + ".der"
|
|
let certificateHostSavedPath = NCUtilityFileSystem().directoryCertificates + "/" + host + ".der"
|
|
var title = NSLocalizedString("_ssl_certificate_changed_", comment: "")
|
|
var title = NSLocalizedString("_ssl_certificate_changed_", comment: "")
|
|
|
|
|
|
@@ -457,8 +468,35 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
// MARK: - Account
|
|
// MARK: - Account
|
|
|
|
|
|
- @objc func changeAccount(_ account: String, userProfile: NKUserProfile?) {
|
|
|
|
|
|
+ func createAccount(server: String, username: String, password: String, completion: @escaping (_ error: NKError) -> Void) {
|
|
|
|
+ var urlBase = server
|
|
|
|
+ if urlBase.last == "/" { urlBase = String(urlBase.dropLast()) }
|
|
|
|
+ let account: String = "\(username) \(urlBase)"
|
|
|
|
+ let user = username
|
|
|
|
+
|
|
|
|
+ NextcloudKit.shared.setup(account: account, user: user, userId: user, password: password, urlBase: urlBase)
|
|
|
|
+ NextcloudKit.shared.getUserProfile { _, userProfile, _, error in
|
|
|
|
+
|
|
|
|
+ if error == .success, let userProfile {
|
|
|
|
+
|
|
|
|
+ NCManageDatabase.shared.deleteAccount(account)
|
|
|
|
+ NCManageDatabase.shared.addAccount(account, urlBase: urlBase, user: user, userId: userProfile.userId, password: password)
|
|
|
|
+
|
|
|
|
+ NCKeychain().setClientCertificate(account: account, p12Data: NCNetworking.shared.p12Data, p12Password: NCNetworking.shared.p12Password)
|
|
|
|
+
|
|
|
|
+ self.changeAccount(account, userProfile: userProfile)
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.errorDescription, preferredStyle: .alert)
|
|
|
|
+ alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
|
|
|
|
+ UIApplication.shared.firstWindow?.rootViewController?.present(alertController, animated: true)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ completion(error)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ func changeAccount(_ account: String, userProfile: NKUserProfile?) {
|
|
NCNetworking.shared.cancelAllQueue()
|
|
NCNetworking.shared.cancelAllQueue()
|
|
NCNetworking.shared.cancelDataTask()
|
|
NCNetworking.shared.cancelDataTask()
|
|
NCNetworking.shared.cancelDownloadTasks()
|
|
NCNetworking.shared.cancelDownloadTasks()
|
|
@@ -489,7 +527,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
NCManageDatabase.shared.setAccountUserProfile(account: account, userProfile: userProfile)
|
|
NCManageDatabase.shared.setAccountUserProfile(account: account, userProfile: userProfile)
|
|
}
|
|
}
|
|
|
|
|
|
- NCPushNotification.shared().pushNotification()
|
|
|
|
|
|
+ NCPushNotification.shared.pushNotification()
|
|
|
|
|
|
NCService().startRequestServicesServer()
|
|
NCService().startRequestServicesServer()
|
|
|
|
|
|
@@ -500,12 +538,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeUser)
|
|
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterChangeUser)
|
|
}
|
|
}
|
|
|
|
|
|
- @objc func deleteAccount(_ account: String, wipe: Bool) {
|
|
|
|
-
|
|
|
|
|
|
+ func deleteAccount(_ account: String, wipe: Bool) {
|
|
UIApplication.shared.allSceneSessionDestructionExceptFirst()
|
|
UIApplication.shared.allSceneSessionDestructionExceptFirst()
|
|
|
|
|
|
if let account = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", account)) {
|
|
if let account = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", account)) {
|
|
- NCPushNotification.shared().unsubscribingNextcloudServerPushNotification(account.account, urlBase: account.urlBase, user: account.user, withSubscribing: false)
|
|
|
|
|
|
+ NCPushNotification.shared.unsubscribingNextcloudServerPushNotification(account: account.account, urlBase: account.urlBase, user: account.user, withSubscribing: false)
|
|
}
|
|
}
|
|
|
|
|
|
NextcloudKit.shared.deleteAppPassword(serverUrl: urlBase, username: userId, password: password) { _, error in
|
|
NextcloudKit.shared.deleteAppPassword(serverUrl: urlBase, username: userId, password: password) { _, error in
|
|
@@ -550,9 +587,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
func updateShareAccounts() -> Error? {
|
|
func updateShareAccounts() -> Error? {
|
|
guard let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) else { return nil }
|
|
guard let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) else { return nil }
|
|
-
|
|
|
|
let tableAccount = NCManageDatabase.shared.getAllAccount()
|
|
let tableAccount = NCManageDatabase.shared.getAllAccount()
|
|
var accounts = [NKShareAccounts.DataAccounts]()
|
|
var accounts = [NKShareAccounts.DataAccounts]()
|
|
|
|
+
|
|
for account in tableAccount {
|
|
for account in tableAccount {
|
|
let name = account.alias.isEmpty ? account.displayName : account.alias
|
|
let name = account.alias.isEmpty ? account.displayName : account.alias
|
|
let userBaseUrl = account.user + "-" + (URL(string: account.urlBase)?.host ?? "")
|
|
let userBaseUrl = account.user + "-" + (URL(string: account.urlBase)?.host ?? "")
|
|
@@ -566,8 +603,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
// MARK: - Reset Application
|
|
// MARK: - Reset Application
|
|
|
|
|
|
- @objc func resetApplication() {
|
|
|
|
-
|
|
|
|
|
|
+ func resetApplication() {
|
|
let utilityFileSystem = NCUtilityFileSystem()
|
|
let utilityFileSystem = NCUtilityFileSystem()
|
|
|
|
|
|
NCNetworking.shared.cancelAllTask()
|
|
NCNetworking.shared.cancelAllTask()
|
|
@@ -587,7 +623,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
// MARK: - Universal Links
|
|
// MARK: - Universal Links
|
|
|
|
|
|
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
|
|
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
|
|
-
|
|
|
|
let applicationHandle = NCApplicationHandle()
|
|
let applicationHandle = NCApplicationHandle()
|
|
return applicationHandle.applicationOpenUserActivity(userActivity)
|
|
return applicationHandle.applicationOpenUserActivity(userActivity)
|
|
}
|
|
}
|