flutter_mailer icon indicating copy to clipboard operation
flutter_mailer copied to clipboard

iOS only mail app is used even though gmail is installed and configured on device

Open keehoo opened this issue 4 years ago • 4 comments

Hi, the library works fine on Android, but for iOS it only uses stock Mail app even though Gmail is installed. Any comment on this functionality? Anyone also experiencing this?

keehoo avatar Jun 26 '20 11:06 keehoo

on ios it uses mfmailcomposeviewcontroller which opens the stock ios mail app. i believe there is way no to change which app gets open, although it seems things might change with ios 14 third-party-default-apps-ios-14, but i cant find how exactly it will work..

a way to open gmail through ios is to use a gmail scheme and open it with url_launcher

import 'package:url_launcher/url_launcher.dart';


final String gmailUrl =  'googlemail://co?subject=$subject&body=$body&to=$email';


if (await canLaunch(gmailUrl)) {
    await launch(gmailUrl);
 }

keep in mind that it does not have html or attachments support.

taljacobson avatar Jun 27 '20 11:06 taljacobson

Since iOS 14 is now out, you can choose the default Mail App.

Will Mailer be updated so it is opening the default Mail App when there is another selectend then the Stock iOS Mail App?

So adding maybe a openDefaultMailApp Function?

TheGlorySaint avatar Oct 19 '20 12:10 TheGlorySaint

@taljacobson I have the same issue. I need to use Email Sender because I attache a file. But EmailSender is not working with another app than the default iOS app. Is there any way to open the selected default app? (Spark in my case)

URL Launcher and SharePlus Packages are working as expected with opening the selected default app on iOS 14 +.

DieGlueckswurst avatar Dec 23 '21 16:12 DieGlueckswurst

been awhile since i researched the subject, but unfortunately don't believe its possible to open a different(not the default ios mail app) email client and attach files.

taljacobson avatar Dec 23 '21 19:12 taljacobson