Flutter Open whatsapp and send message. After message go back to app

  1. Summary of my problem

I am currently working on an app and i want to be able to share a link using whatsapp. My goal is to open whatsapp on a button click, select a person to send the message to and once send to go back to the app.

With the Flutter Launcher plugin i am able to open whatsapp and send a message but once i have send it i stay inside whatsapp instead of going back to the app. Anyone has any ideas how i can achieve the desired result? The plugin basicly opens a web url and then i get redirect to the whatsapp app.

Currently i have this little piece of code to send a message in whatsapp:

_launchURL() async {
const url = ‘https://wa.me/?text=Word%20lid%20van%20blabla%20’;
if (await canLaunch(url)) {
await launch(url);
} else {
throw ‘Could not launch $url’;
}
}

The share plugin would be more suitable for your usecase. This plugin allows you to share content to compatible applications on the phone.

I am not so sure about redirecting back to the app, because once the app is changed, the control goes to whatsapp. Just try once.

Thanks ill give it a try :slight_smile: