I can't get the first message

I can’t get messages from the contacts unless I send a message to them. I wonder if it’s because the Chat that was not created yet. For instance: if I login and send a message to contact abc@def.com, I’m able to get responses and keep chatting with abc@def.com. However if I don’t send any message to abc@def.com, no matter how many messages abc@def.com send to me: I don’t get anything, processMessage is never called.

Do you know why?

Please post your code, let me go through and try to find out where you went wrong

you need to imlement ChatManagerListener

set in ur class implements MessageListener, ChatManagerListener

and than add this function

@Override
public void chatCreated(Chat chat, final boolean createdLocally) {
chat.addMessageListener(this);

}

in your connection and login function add this line conn.getChatManager().addChatListener(this); where conn = Connection

this should be enough

1 Like

Yes, I need to update the documentation so it has a more complete description of how to create or handle new incoming chats.