1

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.

Pooja Pradhan
  • 83
  • 1
  • 7

1 Answers1

2

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().

sme
  • 4,023
  • 3
  • 28
  • 42