When I open attached image inside my iMessage and tap on "Share" button, I can see icons of 3rd party apps like "Path" or "Evernote". The question is: How can I add my own app to this list?
-
I have tried to add "URL Schemes" and "URL Identifier" to my "Information Property List" but with no luck. – rudensm Apr 14 '13 at 09:48
-
That's how you do it. Refer to that question, this one is a dupe. – memmons Apr 14 '13 at 17:49
-
@rudensm: i am trying to do the same,. Can u provide me example for the same. i typed exact same code provide by herzbube but still not able to see my app – Hitu Bansal Jun 08 '15 at 07:33
-
@HituBansal: you better handle this cases with app extensions – rudensm Jun 08 '15 at 10:54
-
@rudensm: i am developing my app using phonegap and totally new to ios. Can u provide an example code or sample code pls – Hitu Bansal Jun 08 '15 at 11:12
-
@HituBansal: the selected answer solves your issue as well. You don't need to do any code here, just put the necessary keys:values in the Info.plist file. – rudensm Jun 08 '15 at 16:16
-
@rudensm: i put below code into my project-info.plist file and coudlnt able to see my app into share pane – Hitu Bansal Jun 09 '15 at 02:53
1 Answers
Instead of a URL scheme you need to add a document type to your app. Try adding the following fragment to your Info.plist
:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>public.jpeg</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>public.jpeg</string>
</array>
</dict>
</array>
With this fragment (specifically with the LSItemContentTypes
key) you declare that your app is an editor for documents that have the Uniform Type Identifier (UTI) public.jpeg
. Because this UTI is declared by the system, I believe it is not necessary that you include the UTI declaration in your app's Info.plist
.
You can find all system-declared UTI's in the Apple document titled System-Declared Uniform Type Identifiers. If you are new to UTI you should probably also read the Apple document Uniform Type Identifier Concepts.
Last but not least, don't forget to consult the Information Property List Key Reference to find out what you should specify for the Core Foundation keys CFBundleTypeRole
and LSHandlerRank
.
BTW: This excellent SO answer also has details about working with UTIs, especially if you ever need to declare your own app-specific UTI.
-
@herzbube. i added above mention code into my project-info.plist file .Still i am not able to see. Can u pls help me out. i am checking this on ios8 – Hitu Bansal Jun 09 '15 at 06:18
-
@HituBansal This still works in iOS 8. The only thing that I can think of that may confuse you is that in some apps (e.g. DropBox) you may first have to select "Open in" before your app shows up. If this isn't your problem then you should ask a new question where you have more space to write (for instance, paste the Info.plist fragment you are using). – herzbube Jun 09 '15 at 06:45
-
@herzbube: Thanks for your reply. let me try it again first, otherwise i will post new plist code . thanjs – Hitu Bansal Jun 09 '15 at 06:58
-
@herzbube: i was not able to do that, i have posted new question along with plist file. see if u can help me out http://stackoverflow.com/questions/30725432/cfbundledocumenttype-is-not-wokring-in-myproject-info-plist-file – Hitu Bansal Jun 09 '15 at 07:23
-
-
Is this still working on iOS 14 and iOS 15? I somehow cannot get it to work for images, but it is working fine for PDF files. – user1195883 Sep 22 '21 at 11:41