Will Universal links be supported in Safari View Controller ?

I have a use case where I have opened up a Safari View Controller within my application to point to my server, and when the server side is done I want to be able to 302 to a Universal Link that calls back into the app layer.

But i read that Universal Links are not supported within Safari View Controller to open an App. It only tries to load the link in the browser itself.

Will this be added in the future ?

What can I do for the use case above in the interim ?

Did you manage to get it work?

Custom URLs work in SFSafariViewController.
If you redirect within SFSafariViewController to a custom url you can detect the custom url in AppDelegate or in newer apps in SceneDelegate.
Here is the way I detect a redirect to a custom url done in SFSafariViewController, the following method is in SceneDelegate.swift:

Code Block Swift
/**
    * Handle Custom Links
    */
  func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
    guard let openURL = URLContexts.first else {return}
    guard let components = NSURLComponents(url: openURL.url, resolvingAgainstBaseURL: false) else {return}
    guard let query = components.queryItems else {return}
    guard let hostname = components.host else {return}
    var params: [String: String] = [:]
    query.forEach {item in
      params[item.name] = item.value
    }
// ... do some action here
}

The redirected url I am handing above is something like: appname://hostname?name=value&name2=value2

Will Universal links be supported in Safari View Controller ?
 
 
Q