I am building an iOS app that I would like to receive shared content from other apps, e.g. Safari web URLs, pasted text etc that the user has shared, either from the Share sheet or from the selected text "Share" button.
My app doesn't seem to appear in the Share sheet at all, except if I specify "com.adobe.pdf" in my info.plist
I've tried:
- public.url
- public.content
- public.data
Here is the entry in my info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
<string>public.url</string>
<string>public.url-name</string>
<string>public.html</string>
<string>public.content</string>
<string>public.data</string>
</array>
</dict>
</array>
I have also tried adding the CFBundleURLTypes key with the following content (With both CFBundleTypeRole set as Editor and Viewer):
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>HTTPS</string>
<key>CFBundleURLSchemes</key>
<array>
<string>https</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>HTTP</string>
<key>CFBundleURLSchemes</key>
<array>
<string>http</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
</dict>
Where am I going wrong? Do I need to write a Share Extension to receive URLs, paste text etc?
Thanks in advance
Chris