从我自己的应用程序启动Mail应用程序(iOS) [英] Launch Mail app (iOS) from my own app

查看:107
本文介绍了从我自己的应用程序启动Mail应用程序(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于此主题有很多问题,但没有更新的答案.我想在没有撰写视图的情况下打开本机iOS邮件应用程序(从我自己的应用程序中).所有答案都可以这么说,但这是不可能的,但是应用程序Slack设法做到了.有人有什么主意吗?

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?

推荐答案

您可以使用message://网址方案(例如,

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];
}

我无法在Apple文档中找到有关它的任何信息,但是该方案存在于邮件的Info.plist的URL方案部分(不是私有url!)中,因此我认为它是公共api的一部分.您还可以在主题此处

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

这篇关于从我自己的应用程序启动Mail应用程序(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆