Question

I would like my app to appear in the UIActivityViewController for text, in other apps. For example, when sharing from the Notes app as shown below.

enter image description here

Adding the following to the Info.plist didn't 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 this possible? How?

Was it helpful?

Solution

Short answer: you can't.

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

What you are likely referring to, though, is the UIDocumentInteractionController, which is different, and there you CAN add your app, and I believe you are doing that correctly.

The things you are trying are all UIActivityViewControllers so no matter how hard you try, your app will not show up there.

Quick note to add: A good way to distinguish between is UIActivityViewControllers and a UIDocumentInteractionController is to see if "Dropbox" comes up in it. From my experience the Dropbox app has a "catch-all" UTI and can take any file so it usually comes up in nearly all UIDocumentInteractionController's. Of course, you'll need to have the app installed

OTHER TIPS

You're plist is wrong, see this answer: Why is my iOS app not showing up in other apps' "Open in" dialog? but to me it looks like you haven't yet set the LSHandlerRankin your plist.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top