我正在使用MFMailComposeViewController撰写带有附件的电子邮件,并且工作正常
现在我想用本机电子邮件客户端撰写带有附件的图像。我正在使用下面的代码
NSString *customURL =[NSString stringWithFormat:@"googlegmail:///co?to=[t0]&subject=[subject]&body=[body]"];
NSURL *url = [NSURL URLWithString:customURL];
if ([[UIApplication sharedApplication]
canOpenURL:url])
{
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
NSLog(@"%d",success);
}];
}
else
{
//not installed, show popup for a user or an error
}
Run Code Online (Sandbox Code Playgroud)
它与主题和正文工作正常,但我无法附加附件(即:Zip 文件、屏幕截图)。
在使用 Gmail 或任何其他客户端应用程序时,有什么方法可以添加附件。