Manage a Group
Get user list to add to a group#
To get the list of users who are eligible to add to a group while creating or to a old group call one of the the below method.
| Argument | Type | Description |
|---|---|---|
| groupJid | String | Jid of a group |
warning
Those above method are available only if contact sync is enabled.
Add Participants to a group#
To add participants to a group, call below method
| Argument | Type | Description |
|---|---|---|
| groupJid | String | Jid of a group |
| newUserJidList | [String] | array of jid list to be added in group (jid list should not contain jid, which is already exiting in same group) |
| completionHandler | FlyCompletionHandler | callback to get success or failure response. implemented as closure expression |
info
if addParticipantToGroup is success, func didAddNewMemeberToGroup(groupJid : String, newMemberJid : String, addedByMemberJid : String) method will be called, which is defined in GroupEventsDelegate.
Remove a Participant from a group#
To remove a participant from a group, call below method
| Argument | Type | Description |
|---|---|---|
| groupJid | String | Jid of a group |
| removeGroupMemberJid | String | jid of participant to be removed from group, who is member of this group) |
| completionHandler | FlyCompletionHandler | callback to get success or failure response. implemented as closure expression |
info
if removeParticipantFromGroup is success, func didRemoveMemberFromGroup(groupJid : String, removedMemberJid : String, removedByMemberJid : String) method will be called, which is defined in GroupEventsDelegate.
Make a participant as Admin#
To make a participant as admin, call below method. Admin only can make a participant as admin.
| Argument | Type | Description |
|---|---|---|
| groupJid | String | Jid of a group |
| userJid | String | jid of the participant, to make as admin |
| completionHandler | FlyCompletionHandler | implemented as closure expression |
info
func didMakeMemberAsAdmin(groupJid: String, newAdminMemberJid : String, madeByMemberJid : String) and func didGroupInfoUpdatedWithId(groupJid: String) method will be called, these are defined in GroupEventsDelegate.
Revoke Admin Access#
Users with admin privileges can revoke a participant's admin access within the group. Only group admins can be perform this action using the below method.
| Argument | Type | Description |
|---|---|---|
| groupJid | String | jid of the group |
| revokeAdminJid | String | jid of the participant, to remove from admin |
| completionHandler | FlyCompletionHandler | implemented as closure expression |
Exit from a Group#
To exit from a group, call below method
| Argument | Type | Description |
|---|---|---|
| groupJid | String | Jid of a group |
| userJid | String | jid of the participant, to exit from the group |
| completionHandler | FlyCompletionHandler | implemented as closure expression |
info
func didLeftFromGroup(groupJid: String, leftUserJid: String) method will be called, these are defined in GroupEventsDelegate.