iOS 7 receiving airdrop files

4.9k Views Asked by At

I'm trying to get my app to register when files are airdropped.

According to apple

To receive files sent via AirDrop, do the following:

In Xcode, declare support for the document types your app supports. (Xcode adds the appropriate keys to your app’s Info.plist file.) The system uses this information to determine whether your app can open a given file.
Implement the application:openURL:sourceApplication:annotation: method in your app delegate. (The system calls this method when a new file is received.)

I added the method to my app delegate. I'm running the ios7 GM on both devices. I added the following to my app plist for doc types

<key>CFBundleDocumentTypes</key>
<array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array/>
            <key>CFBundleTypeName</key>
            <string>images</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.jpeg</string>
                <string>public.image</string>
                <string>public.png</string>
                <string>public.camera-raw-image</string>
                <string>public.content</string>
            </array>
        </dict>
    </array>

As far as I can tell my application:openUrl method is never called. What Am I doing wrong? Do I have to enable something else in order to register for airdrop in my app?

1

There are 1 best solutions below

7
On

Even with other apps installed that I know for a fact will show up in the action sheet for an image sent over iMessage (Evernote, GoToMeeting, Halftone, DropBox), when someone sends me images over AirDrop it doesn't prompt me to choose an application to open it with. Since there's no documentation on this, I suspect Apple treats it the same as trying to have your app show up in the action sheet for images in mail attachments (they just don't show up). I imagine this is because they don't want users confused about images that are sent to them not appearing in the Photos app.