Reputation: 445
What is the best way to get whatsapp messages in the moment messages are received. Is the easiest way to read the notifications of the phone or is there a better way? Root permissions are allowed.
Upvotes: 5
Views: 6229
Reputation: 445
I may have 2 solutions:
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.
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
Upvotes: 1
Reputation: 585
I have also researched in this field, the only best way i found through my research is reading through notifications. As WhatsApp encryption is increased to crypt8, till crypt7 it was possible to do this.
But if you find any other solution to it will be much appreciated.
Upvotes: 0