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?
Launch Mail app (iOS) from my own app
Asked Answered
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
awesome! I was trying to guess what the urlscheme was but mail:// was n't working for me –
Krystakrystal
That
if statement
doesn't read correctly. Is that correct? Shouldn't it be if ([[UIApplication SharedApplication] canOpenURL:mailURL])
???? –
Impatiens @Popeye, you're right - that was copypaste error ) –
Brandy
Great to find this! Do you know if we can use that URL scheme so that Mail app opens an e-mail file (.msg from Outlook or similar) giving a URL where the file is hosted? So something like
message://http://domain/file.msg
. –
Legato © 2022 - 2024 — McMap. All rights reserved.
mailto:
url scheme which will open it in compose view or you could use the hidden url schememessage:
which also opens it in a compose view. There is no way of getting it to open in any other way. It's just not possible. – ImpatiensVladimir
has supplied seems to say it will open the composer view with the message you pass in. – Impatiens