Get WhatsApp messages

点点圈 提交于 2019-12-03 12:06:05

问题


Is it possible to create a listener to get a message from whatsApp in android?
I mean like you have a broadcastReceiver to listen to incoming SMS in android...

Is any API is needed for that thing, or is it legal thing to do or I need to get any permission from whatsApp?


回答1:


Whatsapp did not publish any official APIs.

There's this open source API for communicating with whatsapp, it's not official and might stop working if Whatsapp update their protocols.

https://github.com/venomous0x/WhatsAPI

Regarding the legality of using this or other non-official API, it depends on the service agreement that you agreed to with Whatsapp. Read it and see if they frown upon using their communication protocols with clients other than theirs. My guess would be they do not allow it.

UPDATE: This GitHub repository seems to have been taken offline due to legal threats.




回答2:


It is possible, an example of an Android app that does this is Snowball - basic notification manager that can access WhatsApp message content. I'm not quite sure on how that works, but research Snowball to get more information on how it works.

It is also possible without Android, the source repository on GitHub has been taken down and put back up a few times due to legal threats.

If you do, however, manage to connect to WhatsApp's servers to access incoming and outgoing messages with a desktop app and you don't hide it well, your account will be blocked. WhatsApp notices accounts that send messages faster than it would take for a normal person to send - easy to notice because a human takes time to type, try delaying messages by a random number of seconds to try and hide this. Also note that WhatsApp's terms of service state that you may not run any automated system using the service, i.e. any external app. You may not use the service to advertise or spam (raises red flags pretty fast and gets your account blocked).




回答3:


There is also another library written in Python which you can use write custom application.

It also has terminal client and you run it in interactive mode and also supports group messaging.

There are lots of issues to fix.However you should not be abusive with whatsapp service.Don't use it to spam users.This is reverse engineered library and therefore unofficial.

Here the link:-yowsup



来源:https://stackoverflow.com/questions/16284396/get-whatsapp-messages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!