Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
leo-ori opened this issue Feb 22, 2022 · 0 comments

Comments

@leo-ori
Copy link

leo-ori commented Feb 22, 2022

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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant