Question

Good day, everyone.

I followed these two tutorials line by line, try to associate my app to the csv file (email app attachment), but I after I added these down below changes to my app's plist file, then build my app and run it my device (iPhone 4, iOS 7.0.4), nothing happens, I mean when I clicked on the .csv file in the email, my app still does not show up in the open-in available application list, I just don't know where I did wrong, or iOS 7 has different way doing this?

http://blog.spritebandits.com/2011/12/14/importing-csv-data-file-into-an-ios-app-via-email-attachment/

http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app

this is what my plist changes (the new entries added followed by the tutorial) looks like:

enter image description here

here's the app setting screen:

enter image description here

and here's the xml version:

        <key>CFBundleDocumentTypes</key>
        <array>
            <dict>
                <key>CFBundleTypeName</key>
                <string>CSV Document</string>
                <key>LSHandlerRank</key>
                <string>Owner</string>
                <key>CFBundleTypeRole</key>
                <string>Viewer</string>
                <key>LSItemContentTypes</key>
                <array>
                    <string></string>
                </array>
            </dict>
        </array>
        <key>UTExportedTypeDeclarations</key>
        <array>
            <dict>
                <key>UTTypeDescription</key>
                <string>CSV Document</string>
                <key>UTTypeConformsTo</key>
                <array>
                    <string>public.data</string>
                </array>
                <key>UTTypeIdentifier</key>
                <string>Damian-s.${PRODUCT_NAME:rfc1034identifier}</string>
                <key>UTTypeTagSpecification</key>
                <dict>
                    <key>public.filename-extension</key>
                    <string>csv</string>
                    <key>public.mime-type</key>
                    <string>application/inventorytodo</string>
                </dict>
            </dict>
        </array>
Was it helpful?

Solution

You're missing the UTI type in your CFBundleDocumentTypes definition:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>CSV Document</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSItemContentTypes</key>
        <array>
            <string></string>
        </array>
    </dict>
</array>

should be:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>CSV Document</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>Damian-s.${PRODUCT_NAME:rfc1034identifier}</string>
        </array>
    </dict>
</array>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top