Post

Replies

Boosts

Views

Activity

MFMailCompose won't accept input after iOS 18 upgrade
I'm supporting an older iPad app (UIKit and objective C). The ability to send email is a critical part of our app and it's no longer working after upgrading to iOS 18. Every time we create a MFMailComposeViewController, it refuses to accept input from the user. There are multiple UIViewControllers in our code where we create a MFMailComposeViewController for our users to send email from, and the problem consistently affects all of them. I've upgraded XCode to 16, and written a minimal demo app to try and repro the problem, but haven't been able to repro the problem so far. When the problem happens, in the XCode console I get a warning, "User interaction with com.apple.MailCompositionService was ignored because it is currently presented in an unsupported configuration. Ensure this view's appearance hasn't been modified." We're not really doing anything special with it, just the bare basics you would expect when creating a dialog for a user to send an email. No special formatting. But I can't repro the problem In a minimal demo so there's gotta be something different that I'm not accounting for. Any ideas? Here's the simplest code from our app that triggers the problem: - (IBAction)sendEmailButtonTapped { NSLog(@"Send Email button tapped"); if ([MFMailComposeViewController canSendMail] == NO) { [[[UIAlertView alloc] initWithTitle:@"Mail Problem" message:@"Can't currently send mail. You may not have any mail accounts set up on this iPad." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show]; return; } MFMailComposeViewController* mailComposer = [[MFMailComposeViewController alloc] init]; mailComposer.mailComposeDelegate = self; { NSString * userEmail = [AMPMercuryModel shared].user.userEmail; [mailComposer setCcRecipients:@[userEmail]]; } NSArray* mfrEmail = [AMPMercuryModel shared].selectedManufacturer.orderDeskEmails; if ([mfrEmail count]) [mailComposer setToRecipients:mfrEmail]; [self presentViewController:mailComposer animated:YES completion:nil]; } - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error { [controller dismissViewControllerAnimated:YES completion:nil]; NSString* failureMessage; switch (result) { case MFMailComposeResultFailed: failureMessage = [NSString stringWithFormat:@"%@\n%@",[error localizedDescription],[error localizedFailureReason]]; NSLog(@"Email Error: %@",failureMessage); [[[UIAlertView alloc] initWithTitle:nil message:failureMessage delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show]; break; case MFMailComposeResultSent: default: break; } }
6
0
253
Sep ’24