0

I'm working on a new app and would love to have the following feature. If the user is in Apple's Mail, s/he can have the option to open my app.

EDIT: The comments have pointed me to this question, which is perfect for handling attachments, which I also want to do, but I also want the user to be able to copy some text, a date or an e-mail address, and then open my app with that information in tow.

Is there an API set up whereby I can do this?

Thanks!

Community
  • 1
  • 1
PengOne
  • 48,188
  • 17
  • 130
  • 149
  • 2
    possible duplicate of [How do I associate file types with an iPhone application?](http://stackoverflow.com/questions/2774343/how-do-i-associate-file-types-with-an-iphone-application) – taskinoor Mar 20 '11 at 16:57
  • I'm not so interested in certain file types. I really want to know how to launch my app from Mail with certain information attached, and that info may be a file or a date or an e-mail address or a string of text. – PengOne Mar 20 '11 at 17:08

1 Answers1

2

You can create a custom URL scheme for your app, something like app://path - this is how Facebook handles things, they have URLs like fb://profile/12345.

http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

Cœur
  • 37,241
  • 25
  • 195
  • 267
ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • This is awesome. Thanks! I've only skimmed the link, but to me it does not appear that I can use this to open my app from Mail. It seems instead that this creates a way for me (or others) to open my app from within another application. Am I reading this correctly? – PengOne Mar 20 '11 at 17:20
  • 1
    If your app is sending e-mail notifications, you can include a link using the custom scheme to pass data to the app if the user clicks. You can't extend the default Mail.app copy/paste/select functionality, though - apps cannot add plugins to other apps like that. – ceejayoz Mar 20 '11 at 17:31