powered by Jive Software

Not able to receive the message

Code for receiving message:

var localChatManager: ChatManager = ChatManager.getInstanceFor(connection)

localChatManager.addIncomingListener { from, message, chat ->
Log.v("from ",from.toString())

//other business logic

}

Code for sending message :

var localChatManager: ChatManager = ChatManager.getInstanceFor(connection)

var chat: Chat = localChatManager.chatWith(contactJid)

var message: Message = Message()

message.setBody(msg_text.text.toString())

chat.send(message)