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

问题描述 投票:1回答:1

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

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

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

node.js angular quickblox
1个回答
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
};
© www.soinside.com 2019 - 2024. All rights reserved.