[英]Can I send WhatsApp messages from my Java (or any language) applications?
We can send emails or SMS through our application written in Java or many languages. 我们可以通过我们用Java或多种语言编写的应用程序发送电子邮件或短信。 Is there any mechanism to send WhatsApp messages through our applications / web site?
有没有通过我们的应用程序/网站发送WhatsApp消息的机制?
With this code you can open the whatsapp chat with the given number. 使用此代码,您可以使用给定的号码打开whatsapp聊天。
void openWhatsappContact(String number) {
Uri uri = Uri.parse("smsto:" + number);
Intent i = new Intent(Intent.ACTION_SENDTO, uri);
i.setPackage("com.whatsapp");
startActivity(Intent.createChooser(i, ""));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.