Get All Messages from Whatsapp

Get WhatsApp messages

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.

How to get received whatsapp messages programmatically?

I may have 2 solutions:

  1. Check every x seconds for unread messages and save the id of this message. Next time check again for unread messages which have an id higher than the previous one. Then the app knows which message is new and can read all new ones.

  2. Use AccessibilityService to get notificated when a new message from whatsapp was received and follow the same steps.

Tell me if it helped or if it's a bad idea :D



Related Topics



Leave a reply



Submit