Skip to content

MFMailComposeViewController is not dismissing after tap cancel or send button #191

Description

@leo-ori

Hi guys! I found an issue and actually is pretty easy to fix. I'm seeing that MFMailComposeViewControllerDelegate (in RNMail.m) is not dismissing the MFMailComposeViewController, instead of that look on the rootViewController this is causing that the MFMailComposeViewController remains on screen after tap cancel or send. I added the following line and it's working

[controller dismissViewControllerAnimated:YES completion:nil];

My question is why looking into rootViewController instead of just dismiss the controller?

UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
    while (ctrl.presentedViewController && ctrl != controller) {
        ctrl = ctrl.presentedViewController;
    }
    [ctrl dismissViewControllerAnimated:YES completion:nil];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions