如何在Quickblox聊天应用程序中显示用户状态(在线/离线)

时间:2019-11-06 13:02:54

标签: node.js angular quickblox

我们将Quickblox聊天应用程序集成到我们的项目中。我们在后端使用Node Js,在前端使用Angular 7。我们已经实现了私人聊天和群聊。

现在当我们要显示对手的用户状态时出现问题。它是联机还是脱机。

Quickblox文档中没有明确提及。请帮忙。

1 个答案:

答案 0 :(得分:0)

QuickBlox文档的this部分介绍了管理状态。

要接收用户状态(在线/离线),请使用以下回调:

/*
Returns:
  *  (Integer) userId - The sender ID
  *  (String) type - If user leave the chat, type will be 'unavailable'
*/

QB.chat.onContactListListener = function(userId, type) {
  // callback function
};