Detecting Link tap inside WidgetKit

Hi, I am working on a widget for my existing Mac app. The problem I am running into is that when I add a Link from the widget to the main app, the method 'openURLs' isn't called at all:

- (void) application: (NSApplication *)application openURLs:(NSArray<NSURL *> *)urls 

So I'm not able to direct the app on how to best handle the widget tap.

I'm trying to work around that by trying to detect if a Link was selected. Something like this could work

Link("Test", destination: URL(string: "https://duckduckgo.com")!)
        .environment(\.openURL, OpenURLAction { url in
            print("---> testing link actioned")
            return .systemAction
        })

When I add this to the main app, it works fine. But when I add something like this to the widget, the completion handler isn't called (supposedly).

Can someone confirm if this was supposed to work inside a widget? Or is it only something that works from the main app?

Detecting Link tap inside WidgetKit
 
 
Q