I have an iOS app that I want to be able to send and receive instances of its own file type. The flow would be:
UIActivityViewController. They send it somehow to User 2 (AirDrop, email, whatever).I've got the first part working. I can generate file.myExtension and give the UIActivityViewController a file URL to it. This shows up correctly in AirDrop on user 1's device, and I can transfer the file using AirDrop or email or whatever. But the receiving device refuses to show my app as an option to open the file.
I have tried:
My question: what do I have to do to be able to open a file extension that I own on iOS? Do I define both Imported and Exported UTIs, along with a Document Type? Just one of exported or imported? Any unexpected required attributes?
The CFBundleDocumentTypes key is what you need.  It should be an Array, and each item in the array should be a Dictionary.  Each Dictionary should contain the following keys:
CFBundleTypeIconFiles (Array of Strings)
CFBundleTypeName (String)
CFBundleTypeRole (String)
LSHandlerRank (String)
LSIsAppleDefaultForType (Boolean)
LSItemContentTypes (Array of Strings)
Here is what it looks like for my application (stuff blacked out to avoid revealing my company's identity):

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With