Top level deeplink handling (#1660)

* Handle link opening on the top most levels and prepare for percolating them throughout the app
* Add support for a custom app scheme
* Add specific AppRoute parsers.
* Integrate custom scheme in the AppRouteURLParser
* Switch to `element://call` and cleanup route parsing
This commit is contained in:
Stefan Ceriu
2023-09-11 12:31:31 +03:00
committed by GitHub
parent 0813e13325
commit ee4040141d
19 changed files with 140 additions and 44 deletions
@@ -31,6 +31,9 @@ struct InfoPlistReader {
static let otlpTracingURL = "otlpTracingURL"
static let otlpTracingUsername = "otlpTracingUsername"
static let otlpTracingPassword = "otlpTracingPassword"
static let bundleURLTypes = "CFBundleURLTypes"
static let bundleURLSchemes = "CFBundleURLSchemes"
}
private enum Values {
@@ -111,6 +114,19 @@ struct InfoPlistReader {
infoPlistValue(forKey: Keys.otlpTracingPassword)
}
// MARK: - Custom App Scheme
var appScheme: String {
let urlTypes: [[String: Any]] = infoPlistValue(forKey: Keys.bundleURLTypes)
guard let urlSchemes = urlTypes.first?[Keys.bundleURLSchemes] as? [String],
let scheme = urlSchemes.first else {
fatalError("Invalid custon application scheme configuration")
}
return scheme
}
// MARK: - Mention Pills
/// Mention Pills UTType