Launch Mail app (iOS) from my own app

后端 未结 1 1726
梦毁少年i
梦毁少年i 2021-01-07 04:16

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 fo

相关标签:
1条回答
  • 2021-01-07 04:53

    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

    0 讨论(0)
提交回复
热议问题