Question

I have an app that declares a custom file type (which is just some XML) and when iOS encounters this file on iOS 5, 6 & 7, it knows what to do with it - my app fires up and the file imports just fine.

However on iOS 4.3.3, the custom file type just seems to be thought of as plain text - the email client displays it as such and doesn't give the option to open the file in my app.

Here are the appropriate parts of my app's Info.plist:

    <key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>iBlueSky Format</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>uk.co.tenero.ibluesky</string>
        </array>
    </dict>
</array>

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.data</string>
        </array>
        <key>UTTypeDescription</key>
        <string>iBlueSky File</string>
        <key>UTTypeIdentifier</key>
        <string>uk.co.tenero.ibluesky</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>bsky</string>
            </array>
            <key>public.mime-type</key>
            <string>application/xml</string>
        </dict>
    </dict>
</array>

Can anyone spot what I'm doing wrong?

Support for manipulating files like this came in iOS 3.2, so it should work.

I'm intending to drop support for iOS 4, 5 & 6 in the next major update, but I would like to give users on older devices one more release with this functionality.

Was it helpful?

Solution

Found the problem. I needed to define the app as both the owner and the editor of the file type. On later versions of iOS, it seems defining your app as the owner is sufficient to imply the editor role:

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top