Mayur Shah Mayur Shah - 5 months ago 31
Javascript Question

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

I have integrated quickblox into my app, I want to 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?

Answer Source

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 get all users details from the particular dialog.