title: Access a sent file / imported type identifier
body: <p>I have a SwiftUI app (XCode 14 / iOS 15+) that tries to receive fmp12 files sent from the FileMaker app (using the share sheet). I got to the point that my app is shown in the share sheet and gets started. What I cannot achieve is access to the file.</p>
  <p>Following some tutorials and Apple's documentation I imported &quot;com.filemaker.fmp12&quot; as an imported type identifier in my plist.info and added it to Document Types.</p>
  <p><strong>first strategy: DocumentGroup</strong></p>
  <p>To access the file I have first tried to use a DocumentGroup in SwiftUI based on Apple's documentation here: <a href="https://developer.apple.com/documentation/swiftui/documentgroup" rel="nofollow noreferrer">https://developer.apple.com/documentation/swiftui/documentgroup</a></p>
  <pre><code>@main
  struct KioskBridgeApp: App {
      
      var body: some Scene {
          DocumentGroup(viewing: FMP12File.self) { file in
              KioskBridgeView(file: file.fileURL?.absoluteString ?? &quot;undefined&quot;)
          }
      }
  </code></pre>
  <p>While this works when I send an fmp12 file with the files app, it does not work when I send it from FileMaker: Then it always starts with the Document Browser.
  The document browser also opens when I start the app without sending anything to it and I could not find a hint how to suppress that.</p>
  <p>So I developed the feeling that I might be on the wrong track entirely with DocumentGroup here and so tried I strategy number 2:</p>
  <p><strong>second strategy: App delegate</strong></p>
  <p>Using an Application Delegate as suggested here <a href="https://stackoverflow.com/a/46572886">https://stackoverflow.com/a/46572886</a> and as for the Adaptor here: <a href="https://stackoverflow.com/questions/62538110/swiftui-app-life-cycle-ios14-where-to-put-appdelegate-code">SwiftUI app life cycle iOS14 where to put AppDelegate code?</a> and here <a href="https://developer.apple.com/documentation/swiftui/uiapplicationdelegateadaptor" rel="nofollow noreferrer">https://developer.apple.com/documentation/swiftui/uiapplicationdelegateadaptor</a></p>
  <pre><code>class MyAppDelegate: NSObject, UIApplicationDelegate {
      func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -&gt; Bool {
          print(&quot;application opened with \(url.absoluteString)&quot;)
          return true
      }
  
  @main
  struct DelegateTestApp: App {
      @UIApplicationDelegateAdaptor(MyAppDelegate.self) var appDelegate
  
     var body: some Scene {
          WindowGroup {
              ContentView()
          }
      }
  
  }        
  </code></pre>
  <p>But this delegate is never called, not even when I open my app using the files app.</p>
  <p>I am fairly new to iOS development, so even after hours of reading I am not even sure that any of those strategies is even the right approach. Any help would be highly appreciated.</p>