The user can have multiple privacy lists, but only one can be active.
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.
Create privacy list
A privacy list must have at least one element in order to be created. If no elements are specified, then the list with a given name will be deleted.- Swift
- Objective-C
QBChat
instance will call chatDidSetPrivacyList(withName:)
delegate method.
- Swift
- Objective-C
QBChat
instance will call the chatDidNotSetPrivacyList(withName:error:)
delegate method.
- Swift
- Objective-C
In order to be used the privacy list should be not only set but also activated (set as default).
Activate privacy list
In order to activate rules from a privacy list, you should set it as default.- Swift
- Objective-C
QBChat
instance will call the chatDidSetDefaultPrivacyList(withName:)
method of deledate.
- Swift
- Objective-C
QBChat
instance will call chatDidNotSetDefaultPrivacyList(withName:error:)
delegate method.
- Swift
- Objective-C
Update privacy list
There are some rules you should follow to update a privacy list:- Include all of the desired items (not a “delta”).
- If you want to update or set a new privacy list instead of the current one, you should decline the current default list first.
- Swift
- Objective-C
Retrieve privacy lists
To get a list of all your privacy lists names, use the following request.- Swift
- Objective-C
QBChat
instance will call chatDidReceivePrivacyListNames()
delegate method.
- Swift
- Objective-C
QBChat
instance will call chatDidNotReceivePrivacyListNamesDue(toError:)
delegate method.
- Swift
- Objective-C
Retrieve privacy list by name
To get the privacy list by name, you should use the following method.- Swift
- Objective-C
QBChat
instance will call chatDidReceive(_ privacyList:)
its delegate method.
- Swift
- Objective-C
QBChat
instance will call chatDidNotReceivePrivacyList(withName:error)
delegate method.
- Swift
- Objective-C
Remove privacy list
To delete a list, you can call the method below or you can edit a list and set items tonil
.
- Swift
- Objective-C
QBChat
instance will call chatDidRemovedPrivacyList(withName:)
delegate method.
- Swift
- Objective-C
Before deleting the privacy list, you should decline it.
Blocked user attempts to communicate with user
A user can be blocked in 1-1 dialog and group dialog. In this case, the blocked user receives an error when trying to send a message in a 1-1 dialog and receives nothing when trying to send a message in group dialog.- Swift
- Objective-C