0
votes

I'm trying to get my app to import emailed sqlite files, so I've created the document type and a custom UTI in my info.plist. However, when I receive an emailed sqlite file the option to open in my app doesn't appear:

Here's the document Type definition:

DocType

and here's the UTI

UTI

I've now amended this to the following to create a custom file extension called .icx. However, when I try to open an icx attachment, the only options I am given are Dropbox, Mail and FileAppPro:

<key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array>
                <string>inCommand icon114</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>icx Database</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.ncbath.inControl.icx</string>
            </array>
        </dict>
    </array>


<key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeDescription</key>
            <string>icx Database</string>
            <key>UTTypeIdentifier</key>
            <string>com.ncbath.inControl.icx</string>
            <key>UTTypeSize320IconFile</key>
            <string>inCommand icon114</string>
            <key>UTTypeSize64IconFile</key>
            <string>inCommand icon57</string>
            <key>UTTypeTagSpecification</key>
            <string>Dictionary</string>
            <key>public.filename-extension</key>
            <string>icx</string>
            <key>public.mime-type</key>
            <array>
                <string>application/inControl</string>
            </array>
        </dict>
    </array>
1

1 Answers

0
votes

I've fixed it - I found that if you're not careful when you're using the GUI entry for UTExportedTypeDeclarations and CFBundleDocumentTypes you can get dictionary contents out of order - in my case the UTTypeTagSpecification. I concluded it was best to view the info.plist as source and edit it properly. Here is the working code:

<key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array>
                <string>inCommand icon114</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>icx</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.ncbath.inControl.icx</string>
            </array>
        </dict>
    </array>


<key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeDescription</key>
            <string>icx</string>
            <key>UTTypeIdentifier</key>
            <string>com.ncbath.inControl.icx</string>
            <key>UTTypeSize320IconFile</key>
            <string>inCommand icon114</string>
            <key>UTTypeSize64IconFile</key>
            <string>inCommand icon57</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <string>icx</string>
                <key>public.mime-type</key>
                <string>application/x-inControl</string>
            </dict>
        </dict>
    </array>