Contact List
Learn how to create, update, manage, and add users to your contact list.
The Contact List API is rather straightforward. A user A sends a request to become “friends” with a user B. The user B accepts the friend request. And now the user A and B appear in each other roster.
Visit our Key Concepts page to get an overall understanding of the most important QuickBlox concepts.
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 our Setup page for more details.
- Create a user session to be able to use QuickBlox functionality. See our Authentication page to learn how to do it.
- Connect to the Chat server. See our Connection page to learn how to do it.
Access contact list
The following function gives you access to all contact list items.
Add user to your contact list
To add a user to the contact list, use the following snippet.
Maximum number of contacts is 300.
The QBChat
instance will call its delegate’s chatDidReceiveContactAddRequest(fromUser:)
method and the user will receive the request to be added to the contact list.
Confirm the contact request
To confirm the request, use confirmAddContactRequest()
method.
The QBChat
instance will call chatDidReceiveAcceptContactRequest(fromUser:)
delegate method and this user will be informed that you have accepted the contact request.
Reject the contact request
To reject the request, use the rejectAddContactRequest()
method.
The QBChat
instance will call its chatDidReceiveRejectContactRequest(fromUser:)
delegate method and this user will be informed that you have declined the contact request.
Remove user from the contact list
To remove a previously added user from the contact list, use the following method.
Contact list updates
You can also track contact list updates in a real time by using delegates.
Was this page helpful?