使用java向WhatsApp发送消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19135057/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sending message to WhatsApp using java
提问by Niraj Thakar
Since I found some older posts, that tell that whatsapp doesn't support this, I was wondering if something had changed and if there is a way to open a whatsapp 'chat' with a number that I'm sending. so which api will be useful to me??
由于我发现了一些较旧的帖子,表明 whatsapp 不支持此功能,因此我想知道是否发生了某些变化,以及是否有办法使用我发送的号码打开 whatsapp 的“聊天”。那么哪个api对我有用??
采纳答案by Henno Vermeulen
I have exactly the same question. I found out that it is not officially supported.
我有完全相同的问题。我发现它不受官方支持。
Some people are reverse engineering how whatsapp works and they created an open source php libraryand an open source python library called yowsupused by the openwhatsappapplication.
有些人正在逆向工程 whatsapp 的工作原理,他们创建了一个开源 php 库和一个名为 yowsup 的开源python 库,由openwhatsapp应用程序使用。
You will need a phone to use it and cannot use whatsapp on this phone anymore (may be solved by registering a whatsapp account on a cheap prepaid SIM).
您将需要一部手机才能使用它,并且不能再在这部手机上使用 whatsapp(可以通过在便宜的预付费 SIM 卡上注册一个 whatsapp 帐户来解决)。
Unless you want to port the PHP code to Java or reverse engineer yourself, I think the easiest way for Java is to make a private webserver that runs the PHP library. You could create a very small PHP script that simply calls the library with the receiver and text message as parameters and let Java call that library by posting to that private webpage.
除非您想将 PHP 代码移植到 Java 或自己进行逆向工程,否则我认为 Java 最简单的方法是制作一个运行 PHP 库的私有网络服务器。您可以创建一个非常小的 PHP 脚本,该脚本仅使用接收器和文本消息作为参数调用库,并让 Java 通过发布到该私人网页来调用该库。
I would like to know if others have better ideas and if there is a danger that Whatsapp decides to change how it works so that the open source libraries cannot be used anymore.
我想知道其他人是否有更好的想法,以及 Whatsapp 决定改变其工作方式以便不再使用开源库是否存在危险。