i want to open from my aap. “settings >> mail >> add account ” (the add account page) is it possible.?

北城余情 提交于 2019-12-24 20:21:53

问题


In my app, if the user has not configured their E-mail account on their iPhone, then when the user opens the application, it will ask for e-mail configuration (means the app redirects to "settings >> mail >> add account " add account page),

How can I do that?

I searched and found one similar question in stack overflow but it was not helpful. just like this so question


回答1:


just see the official sample code.Here is the link:SampleCode

find the launchMailAppOnDevice() function.

// Launches the Mail application on the device.
-(void)launchMailAppOnDevice
{
    NSString *recipients = @"mailto:first@example.com?cc=second@example.com,third@example.com&subject=Hello from California!";
    NSString *body = @"&body=It is raining in sunny California!";

    NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
    email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
}

It was useful for me. Hope it can help you.



来源:https://stackoverflow.com/questions/6689152/i-want-to-open-from-my-aap-settings-mail-add-account-the-add-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!