Search code examples
iosswiftuikituidocument

Why is the application package not always a package?


I have a swift app that is a viewer for a document type that is a package. The app exports the UTI for this type (I would prefer to import it, but that has the same problem). The app can open a package if the document is stored in iCloud, but not if the document is stored in Dropbox, oneDrive, or Google Drive.

Is there anything that jumps out as missing in the document type and exported UTI declaration that could cause this?

The document types are:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>JMRI Configuration Profile</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>org.jmri.profile</string>
        </array>
        <key>LSTypeIsPackage</key>
        <true/>
    </dict>
</array>

The exported UTIs are:

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>com.apple.package</string>
            <string>public.composite-content</string>
        </array>
        <key>UTTypeDescription</key>
        <string>JMRI Configuration Profile</string>
        <key>UTTypeIconFiles</key>
        <array>
            <string></string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>org.jmri.profile</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>JMRI</string>
                <string>jmri</string>
            </array>
        </dict>
    </dict>
</array>

Solution

  • The problems I was having with this turn out to be effects of how the underlying apps (Dropbox, Google Drive, and oneDrive) implement support for the FileProvider API.

    Since I originally asked the question, Dropbox has added support for packages, Microsoft has stated that packages are not supported, and I have not found (or figured out how to ask) if Google will support packages.