IOS: How to get message body, subject and recepien

2019-08-24 09:32发布

I am sending email via following method:

-(void) sendEmailOpenControllerWithSubject:(NSString *)subject messsageBody:(NSString *) message
{
    MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
    controller.mailComposeDelegate = self;
    [controller setSubject:subject];
    [controller setMessageBody:message isHTML:NO];
    [controller setToRecipients:[[NSArray alloc] initWithObjects:currentProspect.email, nil]];
    if (controller) [self presentModalViewController:controller animated:YES];
}

I am setting message body subject and recipient but it is likely that user changes these attribute in MailComposer.

What I need:

So I want to get the contents like message body,subject and recipients after the email is sent. As it is possible that user has changed these via mail composer.

1条回答
爷、活的狠高调
2楼-- · 2019-08-24 10:21

Starting in iOS 5, you can register to be notified of changes to the availability of text message sending.

A userInfo dictionary key for the MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification

NSString *const MFMessageComposeViewControllerTextMessageAvailabilityKey;

Refer more on Message UI Framework here

查看更多
登录 后发表回答