Before you begin
- 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.
- Configure QuickBlox SDK for your app. Check out Setup page for more details.
- Create a user session to be able to use QuickBlox functionality. See Authentication page to learn how to do it.
- Connect to the Chat server. See Connection page to learn how to do it.
Access contact list
You can access the contact list on your login to chat. The contact list object will be returned in callback. Also, the following function gives you an access to contact list.JavaScript
Add user to your contact list
To add a user to the contact list, use theadd()
method.
JavaScript
Maximum number of contacts is 300.
onSubscribeListener
callback will be called.
JavaScript
Confirm the contact request
To confirm the request, use theconfirm()
method.
JavaScript
onConfirmSubscribeListener
callback.
JavaScript
Reject the contact request
To reject the request, use thereject()
method.
JavaScript
onRejectSubscribeListener
callback.
JavaScript
Remove user from the contact list
To remove a previously added user from the contact list, use the following method.JavaScript
Contact list updates
You can also track contact list updates in real-time by using the code snippet below.JavaScript