Namespaces
Methods
-
staticQB.chat.connect(params, callback)
modules/chat/qbChat.js, line 707 -
self.connection to the chat(read more)
Name Type Description paramsObject Connect to the chat parameters. Name Type Description userIdNumber Connect to the chat by user id (use instead params.email and params.jid). jidString Connect to the chat by user jid (use instead params.userId and params.email). emailString Connect to the chat by user's email (use instead params.userId and params.jid). passwordString The user's password or session token. callbackchatConnectCallback The chatConnectCallback callback. -
staticQB.chat.disconnect()
modules/chat/qbChat.js, line 1530 -
Disconnect from the Chat(read more).
-
staticQB.chat.getLastUserActivity(jid_or_user_id)
modules/chat/qbChat.js, line 1324 -
Send query to get last user activity by QB.chat.onLastUserActivityListener(userId, seconds)(read more).
Name Type Description jid_or_user_idNumber | String The user id or jid, that the last activity we want to know. -
staticQB.chat.onConfirmSubscribeListener(userId)
modules/chat/qbChat.js, line 257 -
Receive confirm request(read more).
Name Type Description userIdNumber The sender ID -
staticQB.chat.onContactListListener(userId, type)
modules/chat/qbChat.js, line 242 -
Receive user status (online / offline)(read more).
Name Type Description userIdNumber The sender ID. typeString If user leave the chat, type will be 'unavailable'. -
staticQB.chat.onDeliveredStatusListener(messageId, dialogId, userId)
modules/chat/qbChat.js, line 193 -
Receive delivery confirmations(read more).
Name Type Description messageIdString Delivered message id. dialogIdString The dialog id. userIdNumber User id. -
staticQB.chat.onDisconnectedListener()
modules/chat/qbChat.js, line 279 -
Run after disconnect from chat({@linkhttps://docs.quickblox.com/docs/js-chat-connection#disconnect-from-chat-server read more}).
-
staticQB.chat.onJoinOccupant(dialogId, userId)
modules/chat/qbChat.js, line 226 -
You will receive this callback when some user joined group chat dialog you are in.
Name Type Description dialogIdString An id of chat dialog that user joined. userIdNumber An id of user who joined chat dialog. -
staticQB.chat.onKickOccupant(dialogId, initiatorUserId)
modules/chat/qbChat.js, line 218 -
You will receive this callback when you are in group chat dialog(joined) and other user (chat dialog's creator) removed you from occupants.
Name Type Description dialogIdString An id of chat dialog where you was kicked from. initiatorUserIdNumber An id of user who has kicked you. -
staticQB.chat.onLastUserActivityListener(userId, seconds)
modules/chat/qbChat.js, line 271 -
Receive user's last activity (time ago).
Name Type Description userIdNumber The user's ID which last activity time we receive. secondsNumber Time ago (last activity in seconds or 0 if user online or undefined if user never registered in chat). -
staticQB.chat.onLeaveOccupant(dialogId, userId)
modules/chat/qbChat.js, line 234 -
You will receive this callback when some user left group chat dialog you are in.
Name Type Description dialogIdString An id of chat dialog that user left. userIdNumber An id of user who left chat dialog. -
staticQB.chat.onMessageErrorListener(messageId, error)
modules/chat/qbChat.js, line 168 -
Blocked entities receive an error when try to chat with a user in a 1-1 chat and receivie nothing in a group chat.
Name Type Description messageIdNumber The message id. errorObject The error object. -
staticQB.chat.onMessageListener(userId, message)
modules/chat/qbChat.js, line 160 -
You need to set onMessageListener function, to get messages(read more).
Name Type Description userIdNumber Sender id. messageObject The message model object. -
staticQB.chat.onMessageTypingListener(isTyping, userId, dialogId)
modules/chat/qbChat.js, line 184 -
Show typing status in chat or groupchat(read more).
Name Type Description isTypingBoolean Typing Status (true - typing, false - stop typing). userIdNumber Typing user id. dialogIdString The dialog id. -
staticQB.chat.onReadStatusListener(messageId, dialogId, userId)
modules/chat/qbChat.js, line 202 -
You can manage 'read' notifications in chat(read more).
Name Type Description messageIdString Read message id. dialogIdString The dialog id. userIdNumber User Id. -
staticQB.chat.onReconnectListener()
modules/chat/qbChat.js, line 285 -
By default Javascript SDK reconnects automatically when connection to server is lost(read more).
-
staticQB.chat.onRejectSubscribeListener(userId)
modules/chat/qbChat.js, line 264 -
Receive reject request(read more).
Name Type Description userIdNumber The sender ID -
staticQB.chat.onSentMessageCallback(messageLost, messageSent)
modules/chat/qbChat.js, line 176 -
This feature defines an approach for ensuring is the message delivered to the server. This feature is unabled by default(read more).
Name Type Description messageLostObject The lost message model object (Fail). messageSentObject The sent message model object (Success). -
staticQB.chat.onSubscribeListener(userId)
modules/chat/qbChat.js, line 250 -
Receive subscription request(read more).
Name Type Description userIdNumber The sender ID. -
staticQB.chat.onSystemMessageListener(message)
modules/chat/qbChat.js, line 211 -
These messages work over separated channel and won't be mixed with the regular chat messages(read more).
Name Type Description messageObject The system message model object. Always have type: 'headline'. -
staticQB.chat.send(jid_or_user_id, message){String}
modules/chat/qbChat.js, line 1082 -
Send message to 1 to 1 or group dialog(read more).
Name Type Description jid_or_user_idString | Number Use opponent id for 1 to 1 chat, and room jid for group chat. messageObject The message object. Returns:
Type Description String messageId - The current message id (was generated by SDK). -
staticQB.chat.sendIsStopTypingStatus(jid_or_user_id)
modules/chat/qbChat.js, line 1222 -
Send is stop typing status(read more).
Name Type Description jid_or_user_idString | Number Use opponent id for 1 to 1 chat, and room jid for group chat. -
staticQB.chat.sendIsTypingStatus(jid_or_user_id)
modules/chat/qbChat.js, line 1194 -
Send is typing status(read more).
Name Type Description jid_or_user_idString | Number Use opponent id for 1 to 1 chat, and room jid for group chat. -
staticQB.chat.sendReadStatus(params)
modules/chat/qbChat.js, line 1290 -
Send is read status(read more).
Name Type Description paramsObject Object of parameters. Name Type Description userIdNumber The receiver id. messageIdNumber The delivered message id. dialogIdNumber The dialog id. -
staticQB.chat.sendSystemMessage(jid_or_user_id, message){String}
modules/chat/qbChat.js, line 1145 -
Send system message (system notification) to 1 to 1 or group dialog(read more).
Name Type Description jid_or_user_idString | Number Use opponent id for 1 to 1 chat, and room jid for group chat. messageObject The message object. Returns:
Type Description String messageId - The current message id (was generated by SDK).