Launch Apple Mail App from Within My Own App

Launch Apple Mail App from within my own App?

Apparently Mail application supports 2nd url scheme - message:// which ( I suppose) allows to open specific message if it was fetched by the application. If you do not provide message url it will just open mail application:

NSURL* mailURL = [NSURL URLWithString:@"message://"];
if ([[UIApplication sharedApplication] canOpenURL:mailURL]) {
[[UIApplication sharedApplication] openURL:mailURL];
}

Launch Mail app (iOS) from my own app

You can launch mail app using message:// url scheme, e.g.

NSURL* mailURL = [NSURL URLWithString:@"message://"];
if ([[UIApplication sharedApplication] canOpenURL:mailURL]) {
[[UIApplication sharedApplication] openURL:mailURL];
}

I was not able to find any information about it in apple documentation, but the scheme is present in URL schemes section (not private urls!) in mail's Info.plist, so I assume it is a part of a public api. You can also find some information on the topic here

iPhone Email app launch url

I don't think so, since the whole idea of the url schemes is to launch another app given some context in your own app. Watch a specific YouTube vid, write an email, etc.

in addition, this sounds like a weird requirement - why would you just want to send them to their email client without having them compose an email?

Launch Apple Mail App from within my own App?

Apparently Mail application supports 2nd url scheme - message:// which ( I suppose) allows to open specific message if it was fetched by the application. If you do not provide message url it will just open mail application:

NSURL* mailURL = [NSURL URLWithString:@"message://"];
if ([[UIApplication sharedApplication] canOpenURL:mailURL]) {
[[UIApplication sharedApplication] openURL:mailURL];
}

How to launch the iOS mail app in Swift?

Not tested myself but maybe this answer will help you:

Apparently Mail supports a second url scheme message:// which (I suppose) allows you to open a specific message if it was fetched by your application. If you do not provide a full message url, it will just open Mail:

let mailURL = URL(string: "message://")!
if UIApplication.shared.canOpenURL(mailURL) {
UIApplication.shared.openURL(mailURL)
}

Taken from: Launch Apple Mail App from within my own App?

How can to launch the Mail app from within my app?

MFMailComposeViewController is what you want, which was introduced with iPhone OS 3.0.

https://developer.apple.com/iphone/library/samplecode/MailComposer/index.html
http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email

This blog post also covers adding UIImage attachments:

http://howtomakeiphoneapps.com/2009/07/how-to-make-your-iphone-app-send-email-with-attachments/



Related Topics



Leave a reply



Submit