mailto:收件人不在iOS中使用UIActivityViewController

时间:2016-04-07 12:21:09

标签: ios objective-c uiactivityviewcontroller

我正在使用ActivityViewController从App发送邮件。

我能够自动填充主题和身体但不是参与者。

示例代码:

NSURL *recipients = [NSURL URLWithString:@"mailto:foo@bar.com"]; //Not working                
        UIActivityViewController *activityViewController =
        [[UIActivityViewController alloc] initWithActivityItems:@[recipients, @"bodyText"]
                                          applicationActivities:nil];
        [activityViewController setValue:mailSubject forKey:@"Subject"];

        activityViewController.excludedActivityTypes = @[UIActivityTypeMessage, UIActivityTypePostToFacebook, UIActivityTypePostToFlickr, UIActivityTypePostToVimeo, UIActivityTypePostToTencentWeibo, UIActivityTypePostToWeibo];



        [self.navigationController presentViewController:activityViewController
                                                animated:YES
                                              completion:^{

                                              }];

MailTo参与者无法正常工作。 当我运行代码时,会弹出选定的邮件应用程序,但字段为空。

0 个答案:

没有答案