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
The following function gives you access to all contact list items.- Swift
- Objective-C
Add user to your contact list
To add a user to the contact list, use the following snippet.- Swift
- Objective-C
Maximum number of contacts is 300.
QBChat
instance will call its delegate’s chatDidReceiveContactAddRequest(fromUser:)
method and the user will receive the request to be added to the contact list.
- Swift
- Objective-C
Confirm the contact request
To confirm the request, useconfirmAddContactRequest()
method.
- Swift
- Objective-C
QBChat
instance will call chatDidReceiveAcceptContactRequest(fromUser:)
delegate method and this user will be informed that you have accepted the contact request.
- Swift
- Objective-C
Reject the contact request
To reject the request, use therejectAddContactRequest()
method.
- Swift
- Objective-C
QBChat
instance will call its chatDidReceiveRejectContactRequest(fromUser:)
delegate method and this user will be informed that you have declined the contact request.
- Swift
- Objective-C
Remove user from the contact list
To remove a previously added user from the contact list, use the following method.- Swift
- Objective-C
Contact list updates
You can also track contact list updates in a real time by using delegates.- Swift
- Objective-C