How can I make my application appear in the UIActivityViewController for text?

I want my application to appear in the text of the UIActivityViewController for text, in other applications. For example, when sharing a Notes application, as shown below.

enter image description here

Adding the following to Info.plist did not produce any visible results (in Notes, Evernote, and Simplenote):

 <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeIconFiles</key> <array> <string>icon-text-57.png</string> <string>icon-text-72.png</string> <string>icon-text-114.png</string> </array> <key>CFBundleTypeName</key> <string>Text</string> <key>LSHandlerRank</key> <string>Alternate</string> <key>LSItemContentTypes</key> <array> <string>public.text</string> <string>public.plain-text</string> <string>public.utf8-plain-text</string> <string>public.utf16-external-plain-​text</string> <string>public.utf16-plain-text</string> <string>public.rtf</string> </array> </dict> </array> 

Is it possible? How?

+7
ios uti uiactivityviewcontroller info.plist
source share
2 answers

Short answer: you cannot.

Currently, you cannot add your application to other UIActivityViewControllers unless you create your own UTI and application (Notes, Evernote, and Simplenote) to add your code to your application to show yours.

What you most likely have in mind is the UIDocumentInteractionController , which is different, and you can add your application, and I believe that you are doing it right.

All you are trying is UIActivityViewControllers , so no matter how hard you try, your application will not be displayed there.

A quick note: a good way to tell is UIActivityViewControllers , and a UIDocumentInteractionController is to see if Dropbox appears in it. In my experience, the Dropbox app has a UTI trick and can accept any file, so it usually appears in almost all UIDocumentInteractionController . Of course you will need to install the application

+8
source share

You plist are wrong, see this answer: Why is my iOS application not showing up in other applications? "Open to" dialog? but for me it looks like you haven't installed LSHandlerRank in plist .

Also: make sure you follow Apple's own documentation: https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html

+1
source share

All Articles