rohit1814 / flutter_open_whatsapp

A Flutter plugin to open WhatsApp and send message to single number.
MIT License
22 stars 23 forks source link

Country code #5

Open erperejildo opened 4 years ago

erperejildo commented 4 years ago

@rohit1814 when use url_launcher to call a phone number I do something like this:

 final url = "tel:${myInvestment['contact']['phone']}";
                    if (await canLaunch(url)) {
                      await launch(url);
                    } else {
                      throw 'Could not launch $url';
                    }

That would call to the exact phone number I have saved, that means that it would not include extra country codes.

Doing something like this: FlutterOpenWhatsapp.sendSingleMessage(666666666, ""); will open a +34666666666 and it'd work. But it have +34 on my contact it would add another +34 and it would fail.

Also I cannot have another number from a different country because it adds a wront country code.

I think we should have this logic independently on our sides but not on this package