Home > Enterprise >  whatsapp_share2 not select the passes number flutter
whatsapp_share2 not select the passes number flutter

Time:11-25

I'm using this package to share file via whatsapp

whatsapp_share2: ^2.0.2

Everything is okay but when the whatsapp open , the number which i passed before to whatsapp_share function not select and And it wants me to choose the name I want, but I would like it to open automatically on the number that I entered before through the application

This in my code

Future<void> shareFile() async {
  
  Directory? directory = await getExternalStorageDirectory();

  await WhatsappShare.shareFile(
    phone: " 593963631704",
    text: "Ehab Hegazy",
    filePath: [(fileImage!.path)],
  );
}

Can anyone help , please !

What I expect is that WhatsApp will be opened directly on the number that i entered through the application

CodePudding user response:

As I see in your sample code, in the phone property, you're adding an extra which is not necessary.

await WhatsappShare.shareFile(
  text: 'Ehab Hegazy',
  phone: '911234567890', // removed  
  filePath: [(fileImage!.path)],
);

give it another try!

  • Related