This was also raised in FB17028569
I have iOS document based app using DocumentGroup. I can create and save documents as expected. All that functionality is fine.
@main
struct FooBarApp: App {
var body: some Scene {
DocumentGroup(newDocument: { FoobarDocument() }) { config in
MainView(document: config.document)
}
The problem is when I open an app document from Files.app or Messages the document is never opened directly into the editor, the document browser interface is always presented and the user must manually select the document to open an editor.
This also happens when I use
UIApplication.shared.requestSceneSessionActivation(nil, userActivity: activity, options: nil)
to open a new scene. The doc isn't opened into my editor.
I believe my plist document types are setup correctly and that my ReferenceFileDocument
is setup correctly
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>foobar</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>icon-128</string>
<key>CFBundleTypeIconSystemGenerated</key>
<integer>1</integer>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/json</string>
</array>
<key>CFBundleTypeName</key>
<string>Foobar Project</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.digital-dirtbag.foobar</string>
</array>
<key>NSUbiquitousDocumentUserActivityType</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER).ubiquitousdoc</string>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Foobar Project</string>
<key>UTTypeIconFiles</key>
<array>
<string>icon-128.png</string>
</array>
<key>UTTypeIdentifier</key>
<string>com.digital-dirtbag.foobar</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>foobar</string>
</array>
</dict>
</dict>
The question is does DocumentGroup on iOS even support opening documents directly into the editor view?
I know it works on macOS as expected as I tried this with the demo code and it exhibits the same symptoms. Opening a document from iOS Files.app only gets you as far as the document browser while macOS will open an editor directly.