Search code examples
javascriptangularjsquickblox

How to get sender name in message from quickblox in JavaScript SDK?


I have integrated quickblox into my app, I want a name of sender in message

scenario :

currently, I am getting all messages from dialog using dialog id, when I got the message I want to add the name of sender into my message header. like

Mayur (Name of sender) 10:00 PM

Good to go (Message)

Can quickblox provide any way to do like this?


Solution

  • I solved this issue by getting all users ids from dialogs.

    Retrieve all Users
    
    var params = { page: '1', per_page: '100'};
    
    QB.users.listUsers(params, function(err, users){
      if (users) {
        // success
      } else {
        // error
      }
    });
    

    Using this function to get all users details from the particular dialog.