Can I AirDrop from one app to another?

Hi!


I am creating a pair of iOS apps that will use AirDrop to move files between them. These files are either PNG, XML, or HTML files, and they are represented as file-based URLs when passed to the UIActivityViewController.


When I select the PNG file to transmit and I have launched the receiving app (on another iOS device), the "Photos" app opens on the receiving device. My receiver app is set up to import the correct UTI and to open the correct document type, but its AppDelegate application:openURL:sourceApplication:annotation: method is never executed.


Is there a list of AirDrop file types and their mappings to the Apple iOS apps that will automatically open them?


Thanks,


Karl G. Kowalski

According to the documentation:

The Info tab of your Xcode project contains a Document Types section for specifying the document types your app supports. At a minimum, you must specify a name for your document type and one or more UTIs that represent the data type. For example, to declare support for PNG files, you would include public.png as the UTI string. iOS uses the specified UTIs to determine if your app is eligible to open a given document.


If you're using file-based URLs, then my concern would be that the UIActivityViewController is choosing a different UTI than what you specified as the "correct" UTI.


Have you tried manually creating a UIActivityItemSource and specifying a custom UTI to rule out those issues?

I have set the UTI's for document types that my receiver app supports to include PNG files (public.png). When my receiver app is running, and my transmitter app is told to AirDrop a PNG to the receiver device, it appears as though iOS ignores my receiver app and opens "Photos" regardless; my receiver app should get the openURL: method called at the AppDelegate, but never does. In addition, the "Open In..." dialog never appears - the PNG file goes straight to "Photos".


If I specify a "custom" UTI, then my transmitter will only be able to broadcast to the receiver, which also has to know the custom UTI I've specified. Plus, I would have to change the file extension of the file the transmitter is sending to map the custom UTI to the file extension. This defeats the purpose of being able to transmit a PNG file as a PNG file.


I can also transmit the file as raw data, which also defeats the purpose (and similarly requires a custom UTI).


What I'm looking to discover is whether this behavior - iOS taking control of certain specific AirDrop'ped file types and sending them to Apple apps without bothering to see if any other app can handle them - is expected behavior.


Thanks,


Karl G. Kowalski

Did you ever figure out how to do this? I'm having the same problem.

Can I AirDrop from one app to another?
 
 
Q