UTI Conflicts, iOS

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.

This issue happened with GPX files a few years ago. You might find something if you search the forum.

At the time the only solution was to hope everyone would converge on the same UTI. I don’t know if something changed in iOS, but it has not been an issue for me personally recently, nor have any of my users complained for a while.

Long-press and Share seems to work for most users even with this conflict, although some still have this problem. However, if my app uses UIDocumentPickerViewController with my UTI type, it can't select any file if another app "snatched" the extension first. I can use UTTypeCreatePreferredIdentifierForTag to dynamically obtain the effective UTI for the extension, but then I have this problem where apps erroneously declare a single UTI with multiple, unrelated extensions, which UIDocumentPickerViewController to select files I don't even support. Even when I use the newer UTType API, I can't seem to get any UTType that works just for my file extension.

UTI Conflicts, iOS
 
 
Q