nice idea from previous.
I made some tests..
I confirm iOS 13 odds and bugs.
Preamble:
I enabled all flags on plist:
(from https://forums.developer.apple.com/thread/118932)
...
UIFileSharingEnabled
LSSupportsOpeningDocumentsInPlace
UISupportsDocumentBrowser
..
And added ALL types in plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array/>
<key>CFBundleTypeName</key>
<string>abc File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>org.example.app.document.abc</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>abc File</string>
<key>UTTypeIconFiles</key>
<array/>
<key>UTTypeIdentifier</key>
<string>org.example.app.document.abc</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>abc</string>
</array>
</dict>
</dict>
</array>
I logged here:
1)
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
print(documentsDir())
if let url = launchOptions?[.url] as? URL {
// TODO: handle URL from here
openWriteAndCloseLog(msg: "1 " + url.absoluteString, withTimestamp: true)
}
return true
}
2)
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
// TODO: handle URL from here
openWriteAndCloseLog(msg: "2 " + url.absoluteString, withTimestamp: true)
return true
}
3)
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if let url = connectionOptions.urlContexts.first?.url {
// handle
openWriteAndCloseLog(msg: "3 " + url.absoluteString, withTimestamp: true)
}
guard let _ = (scene as? UIWindowScene) else { return }
}
seems we pass ONLY on 3 (as per my debug log I can see inside documents, as I shared via iTunes)
I made a small demo app to test it.
https://github.com/ingconti/DocumentBroswerSampleApp
You can open attachment from (mal for example..)
You will see: