我正在尝试使用 Flutter 通过 WhatsApp 向多个电话号码发送消息:
sendMessage() async {
var number = ["201020402642", "201030666895"];
var baseUrl = "https://api.whatsapp.com/send/";
var urlIos = "";
number.forEach((element) async {
var url = baseUrl +"?phone=${element} &text=msg";
if (await canLaunch(url)) {
await launch(url);
} else {
print("not installed");
}
});
}
它只向最后一个号码发送消息。
有没有办法向一组号码发送消息?
不幸的是,无法使用深层链接同时向超过 1 个号码发送消息。执行此类操作的唯一方法是通过 REST 请求使用 WhatsApp Business API。有一些第三方软件具有此功能,例如https://www.twilio.com/whatsapp https://www.twilio.com/whatsapp
这是 WhatsApp API 文档
https://developers.facebook.com/docs/whatsapp/api/messages/#sending-messages https://developers.facebook.com/docs/whatsapp/api/messages/#sending-messages
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)