Skip to main content

Before you begin

  1. Register a QuickBlox account. This is a matter of a few minutes and you will be able to use this account to build your apps.
  2. Configure QuickBlox SDK for your app. Check out Setup page for more details.
  3. Create a user session to be able to use QuickBlox functionality. See Authentication page to learn how to do it.
  4. Connect to the Chat server. See Connection page to learn how to do it.
Visit Key Concepts page to learn the most important QuickBlox concepts.

Subscribe to contact presence updates

You can track contact list updates in real-time by using the onContactListListener. However, you can track the presence updates of only those users who have been added to the contact list. See this section to learn how to implement the Contact list.
JavaScript

Ping user

QuickBlox SDK can send application-level pings to a user. As a result, you can check if the user is connected to the Chat server. Ping user by ID
JavaScript
ArgumentRequiredDescription
userIdyesID of the user.
function()yesSpecifies a callback function that accepts one argument that specifies what error has happened.
Ping user by JID
JavaScript
ArgumentRequiredDescription
userJidyesUser JID. JID (Jabber ID) of the user in the in the XMPP server. Assigned automatically by the server upon the login to the Chat. The users will have different JIDs for different apps. The JID format is the following:<user_id>-<app_id>@chat.quickblox.com
function()yesSpecifies a callback function that accepts one argument that specifies what error has happened.

Ping server

QuickBlox SDK can send application-level pings to a server. As a result, you can check if there is a connection with the Chat server.
JavaScript
ArgumentRequiredDescription
servernoCustom server address. You can ping a specific chat server. If no server is specified, the server address is taken from the config object. See the Point SDK to enterprise server section to learn how to set up custom server endpoints.
function()yesSpecifies a callback function that accepts one argument that specifies what error has happened.

Set ping timeout

To control how much time it takes to respond to a ping, you should set a pingTimeout. By default, the pingTimeout is 30 seconds. If the response wasn’t received within the specified time frame, then the error callback is called. Set the pingTimeout in seconds, in the CONFIG object. See Initialize SDK section to learn more about other configuration options.
JavaScript