Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS "Open With..." ZIP File

I'm trying to import a ZIP file via the built-in 'Open With...' function.

Here's what I have added to my Info.plist file:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>ZIP Archive</string>
        <key>CFBundleTypeIconFile</key>
        <string>zip</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>CFBundleTypeOSTypes</key>
        <array>
            <string>ZIP </string>
        </array>
        <key>CFBundleTypeExtensions</key>
        <array>
            <string>zip</string>
        </array>
        <key>CFBundleTypeMIMETypes</key>
        <array>
            <string>application/zip</string>
            <string>application/x-zip</string>
            <string>application/x-zip-compressed</string>
        </array>
    </dict>
</array>

However, my app is not appearing when the 'Open With...' view is launched. Why is this?

like image 902
James Anderson Avatar asked Sep 03 '25 16:09

James Anderson


1 Answers

Your problem is that you've failed to declare the relevant uniform type identifier (UTI). For many file types you need to either import or export a UTI; for zip files you needn't bother because it's on the list of UTIs that the system inherently recognises.

So it should be sufficient simply to add the following to your document type:

<key>LSItemContentTypes</key>
<array>
    <string>com.pkware.zip-archive</string>
</array>
like image 90
Tommy Avatar answered Sep 05 '25 08:09

Tommy