1

Trying to launch yahoo mail app with URL launcher package but it is not working.

Trying to launch yahoo mail app with URL launcher package but it is not working. Tried all possibilties but not working, working smoothly in IOS but not on android -- Added intents to android manifest xml files also

Please help !

Subin Saji
  • 11
  • 1

1 Answers1

0

It seems that the url_launcher lib creates an intent with the "VIEW" action in Android which is not the way a mailto request should normally be handled. Maybe this is the reason why the Yahoo mail client does not work in this case. Usually a "SENDTO" action is required.

You can use the android_intent_plus package to create your own intent:

Future<bool> _createMailUsingAndroidIntent() async {
   const intent = AndroidIntent(
     action: 'android.intent.action.SENDTO',
     data: 'mailto:test@example.com',
   );
   try {
     await intent.launch();
     return true;
   } on PlatformException catch (_) {
     return false;
   }
}

Of course this is only needed for Android, for iOS you can use the url_launcher lib.