I come from the world of MAUI and my knowledge in Flutter is very limited, thats why I need your help! 😀
I want to send a text from my MAUI app to my Flutter App using intent
I wrote this function in MAUI
public static async Task SendTextToFlutter()
{
try
{
Intent sendIntent = new Intent();
sendIntent.SetAction(Intent.ActionSend);
sendIntent.SetAction("RECEIVE_INTENT_EXAMPLE_ACTION");
sendIntent.PutExtra(Intent.ExtraText, "text from MAUI");
MainActivity.StartActivity(sendIntent);
}
catch (Exception ex) { };
}
and I followed the link https://pub.dev/packages/receive_intent#add-intent-filter-to-AndroidMainfest.xml and used the receive_intent in my flutter App
Future<void> _initReceiveIntent() async {
// Platform messages may fail, so we use a try/catch PlatformException.
try {
final receivedIntent = await ReceiveIntent.getInitialIntent();
// Validate receivedIntent and warn the user, if it is not correct,
// but keep in mind it could be `null` or "empty"(`receivedIntent.isNull`).
} on PlatformException {
// Handle exception
}
}
when I run my MAUI app and Click the send buttun, the Intent fires and My flutter App is shown and I am happy with that! : )
But I dont know how to get the message that was sent along with the intent “”text from MAUI”” to be extracted and used further in Flutter.
Any help is appreciated
Cheers!