There's a lot of questions on this topic, but no updated answer. I want to open the native iOS mail app WITHOUT the compose view (from within my own app). All answers so for say it's impossible, but the app Slack manages to do this. Anyone have any idea?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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