I am using following code to implement ChatStateLitener to update typing status of another user. but it seems stateChanged function never triggers.
Any help will be highly appreciated.
Chat chat= chatManager.createChat("someone@domain.com", new MessageListenerImpl());
public class MessageListenerImpl implements MessageListener,ChatStateListener {
@Override
public void processMessage(Chat arg0, Message arg1) {
System.out.println("Received message: " + arg1);
}
@Override
public void stateChanged(Chat arg0, ChatState arg1) {
if (ChatState.composing.equals(arg1)) {
MLog.d("Chat State",arg0.getParticipant() + " is typing..");
} else if (ChatState.gone.equals(arg1)) {
MLog.d("Chat State",arg0.getParticipant() + " has left the conversation.");
} else {
MLog.d("Chat State",arg0.getParticipant() + ": " + arg1.name());
}
}
@Override
public void processMessage(Message message) {
}
}