0

I'm wading through the documentation and finding lots of different things about inter-app communication and sending files around and starting apps from other apps, but I haven't found any screenshots or sample results in the documentation. I'm getting overwhelmed and I just want to know what is actually being used to accomplish the thing in the following screenshot:

the overlay that opens when you click the little arrow up box in the upper right corner of the Notes app

Once you click one of the app options in that overlay, another screen opens that contains the text from the Note file, and it is a different screen depending on your choice. If you click Messages, it prepares to send a text. If you click Messenger it prepares to send a message, etc.

It SEEMS like this is just about registering a corresponding file type, but I'm not sure what file type a Notes file really is or if that is what is actually going on at this point. To be clear, I'm asking: what is it that Messages, Mail, Slack, and Messenger do in their apps to make them appear in that list and respond when they are chosen?

EDIT: I've added this to my plist file but I still don't see it appearing from the Notes app:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
    <key>CFBundleTypeName</key>
    <string>text</string>
    <key>LSHandlerRank</key>
    <string>Alternate</string>
    <key>LSItemContentTypes</key>
        <array>
            <string>public.plain-text</string>
            <string>public.text</string>
            <string>public.utf8-plain-text</string>
            <string>public.utf16-external-plain-​text</string>
            <string>public.utf16-plain-text</string>
            <string>com.apple.traditional-mac-​plain-text</string>
        </array>
    </dict>
</array>
KRA2008
  • 121
  • 1
  • 11

2 Answers2

1

If I have understood you correctly, you want your app to appear in the UIDocumentInteractionController when sharing a file. I think below link will be useful

https://developer.apple.com/library/content/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1

For standard UTI links, please refer below link https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html.

An example is shown here https://developer.apple.com/library/content/qa/qa1587/_index.html

Deepika
  • 438
  • 3
  • 6
  • I've edited my question to show what I've added to my plist file but it's still not appearing. Am I not hitting the right UTI? – KRA2008 Mar 28 '18 at 01:06
  • I've also tried public.content and public.data which I'm reading would cover all file types, but still it doesn't work. – KRA2008 Mar 28 '18 at 15:10
  • I did an experiment and found there is something else happening here. I added public.content and public.data to the plist, then I emailed myself a txt document and tried to open it on my phone. My app then showed up in the options of apps to open it with. However, my app still does not show up when I try to export from Notes app. So it looks like whatever the Notes app is doing is not going through that UTI registration thing. Does that make sense? Do you know what else it might be? – KRA2008 Mar 29 '18 at 01:00
  • It turns out I need a Share extension. See my answer. – KRA2008 Apr 10 '18 at 02:08
0

It's a Share app extension. See: https://developer.apple.com/design/human-interface-guidelines/ios/extensions/sharing-and-actions/

KRA2008
  • 121
  • 1
  • 11