Home > Enterprise >  flutter web WhatsApp web won't open
flutter web WhatsApp web won't open

Time:07-06

I have a button when the button is clicked it should open WhatsApp on whatsAppW Web with the given phone number, and I'm using url_luancher

here i want to navigate to whatsApp Url but when i click on the button it won't work.

 _launch(url) async {
    if (await canLaunchUrl(url)) {
      await launchUrl(url);
    } else {
      print("Not supported");
    }
  }

OutlinedButton(
  onPressed: () => 
   _launch(Uri.parse(
  'whatsapp://send?text=sample text&phone=00000000000'));
                

CodePudding user response:

To open via whatsapp web you can use whatsapp api call and use url_launcher to open it in browser

https://api.whatsapp.com/send?phone= 00000000000000&text=iwanttotestit
  • Related