I am using Strophe.js to connect with XMPP server in angular4. connection.addHandler() received a single message. I add this listener after successful connection.
connection.addHandler(this.receiveMessage, null, 'message');
Please tell what I missing or incorrect.
Make sure that your receivedMessage
function returns true
in order to continue to be called when you receive a new message. If it doesn't return true
, it will only be called once and you will have to add it again via connection.addHandler()
.