iOS 13 only detects one of multiple UTI handlers

Hi,


I've had this bug reported by my app users since iOS 13 beta came out. I've created issue 7139263 but I'm also posting here because the release date is dangerously close, as the bug severely affects my app -which today has a hard-worked almost 5 stars rating.


My app ("Passepartout - OpenVPN Client") defines a custom "Extension type" and a corresponding "Imported UTI" for .ovpn files. This way it can open .ovpn files and thus show up as "Copy to Passepartout" in the menus. It has happily coexisted with other apps like OpenVPN Connect doing the same, until iOS 12.


Starting from iOS 13, it looks like as long as other apps handle the same file extension, only one of them makes it to "Copy to ***". In fact, if I uninstall OpenVPN Connect, my app does show up again as usual. If both are installed, only one of them appears. Mostly the other ones, yet not always.


My Info.plist has worked since forever before iOS 13, so behavior must have changed under the hood. I can't exclude that I had been "lucky" with a wrong configuration so far, but the fact of the matter is that I'm kind of left wondering. I don't have elements to assert that this is a bug or some obscure API change.


Either way, I'm looking for either a bugfix or guidelines for how to fix the app on my end. If it's a bug, it's quite a nasty one IMHO.


Follows the relevant excerpt of my Info.plist


Thanks in advance


---


...
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>ovpn</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>app.passepartoutvpn.formats.ovpn</string>
        </array>
    </dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.text</string>
            <string>public.plain-text</string>
        </array>
        <key>UTTypeDescription</key>
        <string>OpenVPN configuration file</string>
        <key>UTTypeIconFiles</key>
        <array/>
        <key>UTTypeIdentifier</key>
        <string>app.passepartoutvpn.formats.ovpn</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>ovpn</string>
                <string>OVPN</string>
            </array>
        </dict>
    </dict>
</array>
...

Replies

A few of us have been complaining about this since June on this thread: https://forums.developer.apple.com/thread/118932


I hadn't spotted that the existence of other apps affects whether an app is offered when sharing. I am trying to import GPX files so, following your experiences, I just uninstalled a few apps that were accepting GPX files (WhatsApp, Messenger, Kindle etc) and it suddenly started working, and continued working after I had re-installed them all.


It is great that it now works but I have no idea what is going on and it is definitely a bug. It's a shame that it is not consistent for you or we could suggest reinstalling other apps as a (far from ideal) workaround.


My current workaround is to offer an Import button that button that displays an instance of UIDocumentPickerViewController. It isn't as good as being able to share a document to the app, but it does allow users a way to import documents that works consistently (I hope) on iOS 13.

I posted a rough mitigation here: https://forums.developer.apple.com/thread/118932