Use a different scheme for Element Call in the form of io.element.call:/?url=some_url

This commit is contained in:
Stefan Ceriu
2023-09-19 15:56:14 +03:00
committed by Stefan Ceriu
parent f045793b36
commit 1fe7d270aa
7 changed files with 43 additions and 21 deletions

View File

@@ -80,15 +80,13 @@ struct ElementAppURLParser: URLParser {
/// The parser for Element Call links. This always returns a `.genericCallLink`
struct ElementCallURLParser: URLParser {
private let knownHosts = ["call.element.io"]
private let customSchemeHost = "call"
private let customSchemeURLQueryParameterName = "url"
func route(from url: URL) -> AppRoute? {
// First try processing URLs with custom schemes
if let scheme = url.scheme,
scheme == InfoPlistReader.app.appScheme {
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false),
components.host == customSchemeHost else {
scheme == InfoPlistReader.app.elementCallScheme {
guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false) else {
return nil
}