What I already found is
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto:"]];
But I just want to open the Mail app not only a composer view. Just the mail app in its normal or last state.
Any ideas?
What I already found is
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto:"]];
But I just want to open the Mail app not only a composer view. Just the mail app in its normal or last state.
Any ideas?
on swift 2.3: open mailbox
You can launch any app on iOS if you know its URL scheme. Don't know that the Mail app scheme is public, but you can be sneaky and try this:
Props to Farhad Noorzay for clueing me into this. It's some bit of reverse engineering the Mail app API. More info here: https://medium.com/@vijayssundaram/how-to-deep-link-to-ios-7-mail-6c212bc79bd9
It will open Default Mail App with composer view:
It will open Default Mail App:
You might want to use a scripting bridge. I used this method in my App to directly give the user the option to send e-mail notifications using the built in Mail.app. I also constructed an option to do this directly over SMTP as an alternate.
But since you want to use Mail.app method, you can find more information about how to do that solution by following this:
https://github.com/HelmutJ/CocoaSampleCode/tree/master/SBSendEmail
Good Luck!
Since the only way to launch other applications is by using their URL schemes, the only way to open mail is by using the mailto: scheme. Which, unfortunately for your case, will always open the compose view.
Run your app on a real device and call
Note, that this line takes no effect on simulator.