|
@@ -931,6 +931,24 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
}
|
|
|
}
|
|
|
return true
|
|
|
+
|
|
|
+ /*
|
|
|
+ Example:
|
|
|
+ nextcloud://open-and-switch-account?user=marinofaggiana&url=https://cloud.nextcloud.com
|
|
|
+ */
|
|
|
+
|
|
|
+ } else if !account.isEmpty && scheme == NCGlobal.shared.appScheme && action == "open-and-switch-account" {
|
|
|
+ guard let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) else { return false }
|
|
|
+ let queryItems = urlComponents.queryItems
|
|
|
+
|
|
|
+ guard let userScheme = CCUtility.value(forKey: "user", fromQueryItems: queryItems) else { return false }
|
|
|
+ guard let urlScheme = CCUtility.value(forKey: "url", fromQueryItems: queryItems) else { return false }
|
|
|
+
|
|
|
+ if getMatchedAccount(userId: userScheme, url: urlScheme) == nil {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ return true
|
|
|
} else {
|
|
|
let applicationHandle = NCApplicationHandle()
|
|
|
let isHandled = applicationHandle.applicationOpenURL(url)
|