1
votes

I'm banging my head against the wall on this one, but just can't seem to make my custom UTI work.

I am working to get AirDrop implemented in my app, so I can share files between devices. Im able to successfully transfer the file(s) the other devices, but the other devices which have my app installed just will not open the files in my app.

Here is the dump from my app.plist:

    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>MYAPP</string>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array>
                <string>57x57</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>MYAPPNAME Shared Assignment</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.MYAPPNAME.SIAASSIGNMENT</string>
            </array>
        </dict>
    </array>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>57x57 2.png</string>
                <string>114x114 2.png</string>
                <string>72x72 2.png</string>
                <string>144x144 2.png</string>
            </array>
        </dict>
    </dict>
    <key>CFBundleIdentifier</key>
    <string>com.MYAPPNAME.${PRODUCT_NAME:rfc1034identifier}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>4.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>4.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string>Main_Window</string>
    <key>NSMainNibFile~ipad</key>
    <string>Main_Window_iPad</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>fetch</string>
        <string>remote-notification</string>
    </array>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIStatusBarTintParameters</key>
    <dict>
        <key>UINavigationBar</key>
        <dict>
            <key>Style</key>
            <string>UIBarStyleDefault</string>
            <key>Translucent</key>
            <false/>
        </dict>
    </dict>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.text</string>
            </array>
            <key>UTTypeDescription</key>
            <string>MYAPPNAME Shared Assignment</string>
            <key>UTTypeIdentifier</key>
            <string>com.MYAPPNAME.SIAASSIGNMENT</string>
            <key>UTTypeSize320IconFile</key>
            <string>72x72</string>
            <key>UTTypeSize64IconFile</key>
            <string>57x57</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>com.MYAPPNAME.SIAASSIGNMENT</key>
                <array>
                    <string>SIAASSIGNMENT</string>
                                <key>public.mime-type</key>
                                <string>application/xml</string>
                </array>
            </dict>
        </dict>
    </array>
</dict>
</plist>

I have tried many different things to make this work, I just can't seem to get iOS7 to recognize that this is my file type. I know that you are not supposed to use the 'public.xxx' namespaces for your UTIs as those are pre assigned by Apple. Any help would be greatly appreciated!

1
Have you tried setting it's type to something not public.*?RyanR
Do you mean do not use public.text, but something else?John Rossitter
Yes, just as an experiment to see if that has anything to do with the problem.RyanR
Yes, I just tried it now, no luck :(John Rossitter
Here are some images of what the UI in XCode5 shows: linkJohn Rossitter

1 Answers

3
votes

Make sure you declare the types as imported so that iOS knows to display your app as an option to open them.

Also, make sure you implement -application:openUrl:sourceApplication:annotation: to receive files through AirDrop or a document interaction controller.