flutter_email_sender icon indicating copy to clipboard operation
flutter_email_sender copied to clipboard

FlutterEmailSender.send(email) does not return to my app

Open BoHellgren opened this issue 4 years ago • 2 comments

I have this button:

FloatingActionButton(
              child: Text( 'Send'),
              onPressed: () async {
                emailAddr = myController.text.trim();
                ...
                String platformResponse;
                  try {
                    await FlutterEmailSender.send(email);
                    platformResponse = 'Email has been sent.';
                  } catch (error) {
                    platformResponse = error.toString();
                  }
                  Scaffold.of(context).showSnackBar(SnackBar(
                      backgroundColor: Colors.green,
                      content: Text(platformResponse)));
                }
               },
            );

This takes me to the Gmail write screen. If I tap the Gmail send icon, all is well - the email is sent, I am returned to my app and the snackbar is shown. But if I choose not to send the email after all and press the back-arrow in the app bar on the Gmail write screen, I am returned to the Gmail inbox and there is no way to get back to my app.

The problem only occurs if Gmail is the default email app. With the Samsung Email app, there is no problem.

Using Flutter 1.20.2 • channel beta and flutter_email_sender: ^3.0.1.

BoHellgren avatar Oct 20 '20 19:10 BoHellgren

I have the same problem. Any ideas?

rlfolden avatar Jan 14 '21 16:01 rlfolden

@rlfolden There is a new version of the plugin - 4.0.0. I haven't tried it. Have you?

BoHellgren avatar Jan 14 '21 17:01 BoHellgren