Mayur Shah Mayur Shah - 1 year ago 74
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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download