Skip to content

Check if iOS has access to a mailing app #15

@KipCrossing

Description

@KipCrossing
final bool canSend = await FlutterMailer.canSendMail();

  if(!canSend && Platform.isIOS) {
    final url = 'mailto:?body=$body&subject=$subject';
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      print("FlutterMailer");
      createAlertDialog(BuildContext context) {
        return showDialog(context: context, builder: (context) {
          return AlertDialog(
            title: Text('Delete all samples'),
            content: Text('Are you sure you want to delete?'),
            actions: [
              MaterialButton(
                child: Text('Ok'),
                onPressed: () {
                  // Navigator.of(context).pop(SampleList());
                },
              ),

            ],
          );
        });
      }
      throw 'Could not launch $url';
    }
  }

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions