6

We would like to give the ability to the user to choose any installed email client (Gmail, Yandex, etc.) in our app. But iOS provides only Mail or builtin MFMailComposeViewController. Is there any way to present a list of email clients to the user?

Dávid Pásztor
  • 51,403
  • 9
  • 85
  • 116
demensdeum
  • 155
  • 3
  • 10

3 Answers3

9

There's no way to achieve this directly, as iOS doesn't know the concept of 'default application'. You could implement yourself a function which checks the various URLs used by different iOS email clients, and determines which clients are installed. For instance, GMail uses googlegmail://. You could also show a menu with the clients found on the device.

If you don't want to create your own implementation, ThirdPartyMailer is a library that can do this for you.

Andrea Gottardo
  • 1,329
  • 11
  • 23
1

If you're looking for something similar to the way Android handles it, then no it's not possible. Some email apps though might support a custom scheme - for example Gmail uses googlegmail:// (taken from this question).

phi
  • 10,634
  • 6
  • 53
  • 88
-3

You should try something like this:

let url = NSURL(string: "mailto:jon.doe@mail.com")
UIApplication.sharedApplication().openURL(url)
Maxime
  • 1,332
  • 1
  • 15
  • 43