sidlatau / flutter_email_sender

Allows send emails from flutter using native platform functionality.
Apache License 2.0
146 stars 81 forks source link

[iOS 14] Add the `mailto` URL mode as first choice for sending email #76

Open matpag opened 2 years ago

matpag commented 2 years ago

iOS 14 added the ability to change the predefined email app.

Instead of relying only on MFMailComposeViewController we can try to use the mailto alternative which will re-direct to the predefined email app configured by user.

On iOS 14+ if the attachments param is null (attachments are not supported by mailto protocol) we could try with mailto URL and if it fails fallback to MFMailComposeViewController.

More details here: https://stackoverflow.com/a/66379220/2910520