My iOS app wants to associate itself with a certain file extension, let's say .aaa
. To do so I declare the following exported type:
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>AAA File</string>
<key>UTTypeIdentifier</key>
<string>com.myapp.aaa</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>aaa</string>
</array>
</dict>
</dict>
As well as this under the supported document types:
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>aaa</string>
</array>
<key>CFBundleTypeName</key>
<string>AAA File</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myapp.aaa</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
Turns out, several other apps on the App Store also register the .aaa
file extension, each under a different UTI, making it impossible to open .aaa
in my app if they installed it after already having installed another app claiming this extension.
Moreover, some of these app declare all of their supported file extensions under a single UTI (e.g. both .aaa
and .bbb
are associated with the com.theirapp.generic
UTI), so I can't even add their UTI to LSItemContentTypes
without associating myself with files I don't support.
How do I force iOS to allow opening every file with the .aaa
extension with my app, regardless of any potential third-party app registering the same extension?
For clarification – the .aaa
file extension in this example is always associate with a single type and format, but it doesn't have an agreed-on UTI identifier or MimeType, nor is there a single app that should be the sole "exporter" of the UTI type.