2015-09-26 76 views
0

我可以检查是否在iPhone上配置了此电子邮件客户端:如何以编程方式打开电子邮件配置表?

if ([MFMailComposeViewController canSendMail]) 
{ 
    // Actions to send mail 
} 
else 
{ 
    //Actions to show an error message by UIAlertView 
} 

我怎样才能将用户重定向到电子邮件帐户配置表我没有电子邮件帐户配置了吗?

回答

2

您可以打开首选项应用,但不能更多。从iOS8开始,只需使用以下代码:

NSURL *settingsAppURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; 
[[UIApplication sharedApplication] openURL:settingsAppURL]; 
+0

应用程序在哪里正确地完成它。 – confile

相关问题