JavaWhatsApp icon indicating copy to clipboard operation
JavaWhatsApp copied to clipboard

Message Listening does not working.

Open sadiqodho opened this issue 8 years ago • 0 comments

  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.

sadiqodho avatar Mar 14 '16 12:03 sadiqodho