JavaWhatsApp
JavaWhatsApp copied to clipboard
Message Listening does not working.
boolean run = true;
Client.init("/usr/bin/python", "JavaWhatsApp/yowsup/yowsupclient.py");
while (run) {
Client.ListenIncomingMessages();
ArrayList<Contact> unreaden = Client.getUnseenContacts();
if (!unreaden.isEmpty()) {
for (Contact ur : unreaden) {
String from = ur.getNumber();
String text = ur.getUnseenMessage();
System.out.println(from + "-" + text);
if (text.equals("stop")) {
Client.killit();
run = false;
break;
}
}
} else {
System.out.println("There are not new messages");
}
}
When I try to send message from my Whatsapp to device. there is no message received. But yowsup python api does work fine. Anyone to find out reason.