简体   繁体   English

使用java向WhatsApp发送消息

[英]Sending message to WhatsApp using java

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. 由于我发现了一些较旧的帖子,告诉whatsapp不支持这个,我想知道是否有什么变化,如果有办法用我正在发送的号码打开一个whatsapp'聊天'。 so which api will be useful to me?? 哪个api对我有用?

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 library and an open source python library called yowsup used by the openwhatsapp application. 有些人正在逆向工程whatsapp如何工作,他们创建了一个开源php库openwhatsapp应用程序使用的名为yowsup的开源python库

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. 除非您想将PHP代码移植到Java或自己进行反向工程,否则我认为Java的最简单方法是创建一个运行PHP库的私有Web服务器。 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通过发布到该专用网页来调用该库。

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决定改变它的工作方式存在危险,那么开源库就不能再使用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM