taljacobson / flutter_mailer

A wrapper on top of MFMailComposeViewController from iOS and Mail Intent on android
MIT License
47 stars 39 forks source link

Unable to detect email client apps. #61

Open cmeuser opened 6 months ago

cmeuser commented 6 months ago

Package Version: 2.1.2 Flutter Channel: Stable Flutter Version: 3.19.5 Devices: Samsung 24 Ultra, Pixel 6 Pro

Issue:

Unable to detect email client apps. I need to pop up the user's email client with the subject, message and a file attachment (screenshot). The following code is unable to detect that I have the Google Mail app installed on my device. It doesn't detect Yahoo or Outlook apps either. The default share bottomsheet is displayed and works as designed; however, I need to restrict the end user to email clients.

const GMAIL_SCHEMA = 'com.google.android.gm'; . . . final bool gmailinstalled = await FlutterMailer.isAppInstalled(GMAIL_SCHEMA); var schema = gmailinstalled ? GMAIL_SCHEMA : ''; . . . final MailOptions mailOptions = MailOptions( body: body, subject: subject, recipients: [recipient], isHTML: false, attachments: [attachmentPath], appSchema: schema, );

await FlutterMailer.send(mailOptions);

Thanks,

Chris