How can I detect if my app was opened by tapping a Live Activity?

I'm developing a flutter app and successfully set up live activities. How can I determine if my app was launched by tapping on a live activity widget? I know I can include a button with a Link but I'm curious how I can handle any click from the widget (i.e if a user taps on the dynamic island, it launches the app) and redirect to the right url inside my app. I've looked through the docs and haven't found any solution.

Thanks

To quote the documentation

If you don’t explicitly provide a deep link into your app with widgetURL(_:) or Link, the system launches your app and passes a NSUserActivity object to the scene(_:willContinueUserActivityWithType:) and scene(_:continue:) callbacks. Implement both callbacks and check whether the NSUserActivity object’s activityType is NSUserActivityTypeLiveActivity, and add code to open a screen in your app that fits the context of the active Live Activity.

So if you omit widgetURL and Links you should be able to check for the incoming activity type to be NSUserActivityTypeLiveActivity. Maybe this type will also be set when using widgetURL and Links but I haven't tried that yet.

I see there is a delegate method that can be implemented on Scene but what about AppDelegate?

How can I detect if my app was opened by tapping a Live Activity?
 
 
Q