My app is successfully opening and setting the parameters (from URL-scheme i.e. myApp://sometextToPrint) to a variable in the AppDelegate class but whenever I w
Copy your code from
func application(_ app: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:])
-> Bool {
into
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?)
-> Bool {
In that method, check the launchOptions. If it contains the url key, grab that value — and return false.
if let url = launchOptions[.url] as? URL {
let geturl = url.host?.removingPercentEncoding
UserDefaults.standard.set(geturl, forKey: "DeepLinkUrl")
return false
}