Message Receive

iFlyChat JavaScript SDK fires an event named 'message-receive' whenever a new message is received. You may bind to this event in the following manner:

iflychat.on('message-receive', function(message) {

/* your code here - message object contains received message information */

});

 

Here message is a JS object with the following properties:

  • fromId
  • fromName
  • toId
  • toName
  • message
  • messageId