Troubleshooting Custom File Extension Recognition in iOS 17 with AirDrop and UIDocumentPickerViewController

Since the release of iOS 17, my application is no longer recognized as the default option for opening my custom file extension via AirDrop. I understand that Apple has modified AirDrop functionality to integrate more closely with the Files app. However, within the Files app, my file package is erroneously identified as a folder, thus ignoring my specified file extension. Additionally, my attempts to utilize UIDocumentPickerViewController for opening these files have been unsuccessful, as it fails to recognize the file type.

I have explored various approaches with UIDocumentPickerViewController, including the following implementation:

let importCustomFiles = UIAlertAction(title: "Import custom file", style: .default) { _ in
let myExtensionType = UTType(filenameExtension: "MyExtension")!
let pickerViewController = UIDocumentPickerViewController(forOpeningContentTypes: [myExtensionType])
pickerViewController.delegate = self
pickerViewController.allowsMultipleSelection = false
pickerViewController.shouldShowFileExtensions = true
self.present(pickerViewController, animated: true, completion: nil)
}

Below is an excerpt from my Info.plist file, detailing the relevant configurations for my custom file extension:

<!-- MyExtension Document Type -->
<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array>
            <string>MyApp File Icon</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Angles MyExtension</string>
        <key>LSHandlerRank</key>
        <string>Default</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>au.com.mycompany.myapp.MyExtension</string>
        </array>
        <key>LSTypeIsPackage</key>
        <true/>
    </dict>
</array>

<!-- Exported Type Declaration for MyExtension -->
<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.directory</string>
        </array>
        <key>UTTypeDescription</key>
        <string>Custom file extension for MyExtension files</string>
        <key>UTTypeIconFiles</key>
        <array>
            <string>MyApp File Icon</string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>au.com.mycompany.myapp.MyExtension</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>myextension</string>
            </array>
        </dict>
    </dict>
</array>

<!-- Imported Type Declaration for MyExtension -->
<key>UTImportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.directory</string>
        </array>
        <key>UTTypeDescription</key>
        <string>Custom file extension for MyExtension files</string>
        <key>UTTypeIdentifier</key>
        <string>au.com.mycompany.myapp.MyExtension</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>myextension</string>
            </array>
        </dict>
    </dict>
</array>

I am seeking assistance in resolving this issue so that my application can properly recognize and open files with my custom extension, both via AirDrop and within the Files app. Any insights or suggestions would be greatly appreciated.

You’re talking about this issue, right?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Troubleshooting Custom File Extension Recognition in iOS 17 with AirDrop and UIDocumentPickerViewController
 
 
Q