I am using an api to get users data and i want to send messages to every users what's app number on click in flutter app. How to do this ?
CodePudding user response:
https://www.youtube.com/watch?v=-wW2ZoDuFO4&t=391s
if windwos platform u can see my video
CodePudding user response:
Use the plugin.
https://pub.dev/packages/url_launcher
final url = "https://wa.me/91XXXXXXXXXX?text=Hello";
//do not forgot to enter your country code instead of 91 and instead of XXXXXXXXXX enter phone number.
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
} else {
showSnackBar(message: "Can't share link", title: "Error");
}
if (!await launchUrl(Uri.parse(url))) throw 'Could not launch $url';