title: Problems starting ViewController from a widget click
body: <p>I have a widget and want to open a particular ViewController when clicking on it. I've read all the documentation and questions on SO regarding the topic, and can't figure out why it isn't working. When clicking the widget, it always opens the default ViewController.</p>
  <p>Here's the code for the WidgetView.</p>
  <pre><code>struct WidgetAdapter : View {
  
      let entry: TimeLine.Entry
      @Environment(\.widgetFamily) var family
  
      @ViewBuilder
      var body: some View {
          switch family {
          case .systemSmall:
              SmallView(...).widgetURL(URL(string: &quot;fcv://open_activity&quot;))
          case .systemMedium:
              MediumView(...).widgetURL(URL(string: &quot;fcv://open_activity&quot;))
          default:
              LargeView(...).widgetURL(URL(string: &quot;fcv://open_activity&quot;))
          }
      }
  }
  </code></pre>
  <p>Here the AppDelegate method for managing URLs.</p>
  <pre><code>func application(_ application: UIApplication, open
                      url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -&gt; Bool{ 
      if url.scheme == &quot;fcv&quot;{
          let storyboard = UIStoryboard(name: &quot;Main&quot;, bundle: nil)
          let vc = storyboard.instantiateViewController(withIdentifier: &quot;WidgetActivity&quot;) as! WidgetActivityController
          self.window?.rootViewController = vc
          self.window?.makeKeyAndVisible()
      }
      return true
  }
  </code></pre>
  <p>I also tried implementing the respective method for the SceneDelegate, I added the url scheme to the URL Types in project info, I added the LSApplicationQueriesSchemes item to the info.plist, used Link instead of .widgetURL... And it didn't work even once. I also think that the method in the AppDelegate is not being called, however, I checked for the cases were that can happen and they don't come to case.</p>
  <p>Any help would be appreciated.</p>