I've defined a URL scheme for my application, and that's being honored by iOS. But the function that's supposed to handle the URL in my appliation (as documented here) is never called.
The documentation doesn't say exactly where this is supposed to go. I've tried it in my App struct:
@main
struct MyGreatApp: App
{
var body: some Scene
{
WindowGroup
{
MainView()
}
}
// Handle custom URLs, specifically the ones sent in invitation E-mails or texts.
func application(_ application: UIApplication,
open theURL: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:] ) -> Bool
{
// Determine who sent the URL.
let sendingAppID = options[.sourceApplication]
print("source application = \(sendingAppID ?? "Unknown")")
...
And I also tried putting this at the file level. No dice either way. Anybody have an idea why?
To head off things I've seen in other posts: I'm not using scenes, and there's no SceneDelegate.